public class SaperionStoreContentInputStream extends InputStream implements Serializable
InputStream is used to transport content to store in a saperion document. It does all the necessary
operations on the content like zipping, length determination and serialization.| Modifier and Type | Field and Description |
|---|---|
static String |
NAME_MD_5 |
static String |
NAME_SHA_512 |
static long |
UNKNOWN_SIZE |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
DocumentElementContentHash |
getHash()
This method returns a hash over the content of the document.
|
long |
getStreamSize()
This method returns the number of bytes the stream holds.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
static SaperionStoreContentInputStream |
newInstance(InputStream content,
int chunkSize,
int inMemoryBytes,
File tempFileDirectory)
This factory returns a SaperionStoreContentInputStream for the given input stream.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
public static final long UNKNOWN_SIZE
public static final String NAME_SHA_512
public static final String NAME_MD_5
public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreampublic long getStreamSize()
UNKNOWN_SIZE.public DocumentElementContentHash getHash()
public static SaperionStoreContentInputStream newInstance(InputStream content, int chunkSize, int inMemoryBytes, File tempFileDirectory)
SerializableInputStream its wrapped stream is used instead.
If content already is a SaperionStoreContentInputStream no new instance will be created.content - the stream to create a SaperionStoreContentInputStream forchunkSize - the size of the chunks in which the underlying stream is to serializeinMemoryBytes - the size of the largest stream that should be streamed to memorytempFileDirectory - the directory to store the temporary files toCopyright © 2016 SAPERION AG. All rights reserved.