public abstract class InStream extends InputStream
Modifier and Type | Class and Description |
---|---|
static class |
InStream.EncryptedStream
Implements a stream over an encrypted, but uncompressed stream.
|
static class |
InStream.StreamOptions |
static class |
InStream.UncompressedStream
Implements a stream over an uncompressed stream.
|
Modifier and Type | Field and Description |
---|---|
protected DiskRangeList |
bytes |
protected long |
length |
protected Object |
name |
protected long |
offset |
protected long |
position |
static int |
PROTOBUF_MESSAGE_MAX_LIMIT |
Constructor and Description |
---|
InStream(Object name,
long offset,
long length) |
Modifier and Type | Method and Description |
---|---|
abstract void |
changeIv(Consumer<byte[]> modifier) |
abstract void |
close() |
static InStream |
create(Object name,
DiskRangeList input,
long offset,
long length)
Create an input stream from a list of disk ranges with data.
|
static InStream |
create(Object name,
DiskRangeList input,
long offset,
long length,
InStream.StreamOptions options)
Create an input stream from a list of disk ranges with data.
|
static com.google.protobuf.CodedInputStream |
createCodedInputStream(InStream inStream)
Creates coded input stream (used for protobuf message parsing) with higher
message size limit.
|
static InStream.StreamOptions |
options() |
protected void |
reset(DiskRangeList input)
Reset the input to a new set of data.
|
abstract void |
seek(PositionProvider index) |
protected abstract void |
setCurrent(DiskRangeList newRange,
boolean isJump)
Set the current range
|
String |
toString() |
available, mark, markSupported, read, read, read, reset, skip
public static final int PROTOBUF_MESSAGE_MAX_LIMIT
protected final Object name
protected final long offset
protected final long length
protected DiskRangeList bytes
protected long position
public InStream(Object name, long offset, long length)
public abstract void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
protected abstract void setCurrent(DiskRangeList newRange, boolean isJump)
newRange
- the block that is currentisJump
- if this was a seek instead of a natural readprotected void reset(DiskRangeList input)
input
- the input datapublic abstract void changeIv(Consumer<byte[]> modifier)
public abstract void seek(PositionProvider index) throws IOException
IOException
public static InStream.StreamOptions options()
public static InStream create(Object name, DiskRangeList input, long offset, long length, InStream.StreamOptions options)
name
- the name of the streaminput
- the list of ranges of bytes for the stream; from disk or cacheoffset
- the first byte offset of the streamlength
- the length in bytes of the streamoptions
- the options to read withpublic static InStream create(Object name, DiskRangeList input, long offset, long length)
name
- the name of the streaminput
- the list of ranges of bytes for the stream; from disk or cachelength
- the length in bytes of the streampublic static com.google.protobuf.CodedInputStream createCodedInputStream(InStream inStream)
inStream
- the stream to wrap.Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.