Package com.saperion.rmi
Class SaContentStream
- java.lang.Object
-
- java.io.InputStream
-
- com.saperion.rmi.SaContentStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class SaContentStream extends java.io.InputStream
InputStream
extension to stream the document content.
Wrapper for theInputStream
to extend the stream with filename extension for the backend.
Delegates most of the overwrittenInputStream
methods to the underlying stream, injected by the constructor.- Author:
- mal
-
-
Constructor Summary
Constructors Constructor Description SaContentStream(java.io.InputStream in, java.lang.String newFileName)
Contructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
boolean
equals(java.lang.Object obj)
java.lang.String
getFileName()
int
hashCode()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
long
skip(long n)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Returns:
- Next byte from stream
- Throws:
java.io.IOException
- IO exception- See Also:
InputStream.read()
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
- IO exception- See Also:
InputStream.close()
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
- IO exception- See Also:
InputStream.reset()
-
getFileName
public java.lang.String getFileName()
- Returns:
- Content file name
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Returns:
- the number of bytes that can be read from this input stream without blocking.
- Throws:
java.io.IOException
- IO exception- See Also:
InputStream.available()
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classjava.io.InputStream
- See Also:
InputStream.mark(int)
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.InputStream
- See Also:
InputStream.markSupported()
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.read(byte[], int, int)
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.read(byte[])
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
- See Also:
InputStream.skip(long)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
-