public class ASMemoryInStream extends SeekableInputStream
isClosed, isSourceClosed, resourceUsers| Constructor and Description |
|---|
ASMemoryInStream(ASMemoryInStream stream,
int offset,
int length)
Constructor that creates substream from other ASMemoryInStream.
|
ASMemoryInStream(byte[] buffer)
Constructor from byte array.
|
ASMemoryInStream(byte[] buffer,
int bufferSize)
Constructor from byte array and actual data length.
|
ASMemoryInStream(byte[] buffer,
int bufferSize,
boolean copyBuffer)
Constructor from byte array and actual data length.
|
ASMemoryInStream(InputStream stream)
Constructor from other stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
closeResource()
Closes stream.
|
long |
getOffset()
Gets offset of current byte.
|
ASInputStream |
getStream(long startOffset,
long length)
Gets substream of this stream that starts at given offset and has given
length.
|
long |
getStreamLength()
Gets total length of stream.
|
boolean |
isCopiedBuffer() |
int |
peek()
Gets next byte without reading it.
|
int |
read()
Reads single byte.
|
int |
read(byte[] buffer,
int size)
Reads up to size bytes of data into given array.
|
void |
reset()
Resets stream.
|
void |
seek(long offset)
Goes to a particular byte in stream.
|
int |
skip(int size)
Skips up to size bytes of data.
|
decrementResourceUsers, getSeekableStream, incrementResourceUsers, isEOF, readByte, seekFromCurrentPosition, seekFromEnd, unread, unreadclose, createStreamFromStreammark, markSupported, read, read, skippublic ASMemoryInStream(byte[] buffer)
buffer - byte array containing data.public ASMemoryInStream(InputStream stream) throws IOException
stream - is stream to read into byte array.IOExceptionpublic ASMemoryInStream(ASMemoryInStream stream, int offset, int length)
stream - is stream, from which substream will be taken.offset - is beginning of data to copy.length - is length of data to copy.public ASMemoryInStream(byte[] buffer,
int bufferSize)
buffer - byte array containing data.bufferSize - actual length of data in buffer.public ASMemoryInStream(byte[] buffer,
int bufferSize,
boolean copyBuffer)
buffer - byte array containing data.bufferSize - actual length of data in buffer.copyBuffer - is true if buffer should be copied deeply. Note that if
it is set into false then internal buffer can be changed
from outside of this class.public int read(byte[] buffer,
int size)
throws IOException
read in class ASInputStreambuffer - is array into which data is read.size - is maximal amount of data that can be read.IOExceptionpublic int read()
throws IOException
read in class ASInputStreamIOExceptionpublic int peek()
throws IOException
peek in class SeekableInputStreamIOExceptionpublic int skip(int size)
throws IOException
skip in class ASInputStreamsize - is amount of bytes to skip.IOExceptionpublic void closeResource()
throws IOException
closeResource in class ASInputStreamIOExceptionpublic void reset()
throws IOException
reset in class ASInputStreamIOExceptionpublic long getStreamLength()
throws IOException
getStreamLength in class SeekableInputStreamIOExceptionpublic long getOffset()
throws IOException
getOffset in class SeekableInputStreamIOExceptionpublic void seek(long offset)
throws IOException
SeekableInputStreamseek in class SeekableInputStreamoffset - is offset of a byte to go to.IOExceptionpublic int available()
available in class InputStreampublic boolean isCopiedBuffer()
public ASInputStream getStream(long startOffset, long length) throws IOException
SeekableInputStreamgetStream in class SeekableInputStreamstartOffset - is starting offset of substream.length - is length of substream.IOExceptionCopyright © 2015–2019 The veraPDF Consortium. All rights reserved.