public class MemoryInputStream extends DataInputStream
Constructor and Description |
---|
MemoryInputStream(byte[] buffer)
Creates a new instance of MemoryInputStream
|
MemoryInputStream(byte[] buffer,
int begin)
Creates a new instance of MemoryInputStream
|
MemoryInputStream(byte[] buffer,
int begin,
int end)
Create an InputStream on top of a byte array.
|
MemoryInputStream(DataInput in,
int size) |
Modifier and Type | Method and Description |
---|---|
int |
directRead(long from,
byte[] arr)
Read from the offset position without buffering.
|
long |
getFilePointer()
Gets the filePointer attribute of the DataInputStream object
|
long |
getMarkPointer()
Returns the offset of the mark if any, else returns 0.
|
void |
jump() |
long |
length()
Description of the Method
|
void |
mark(long skip)
Denote position at getFilePointer+skip for
DataInput.jump() . |
int |
read(byte[] arr,
int offset,
int max_len) |
byte |
readByte()
Description of the Method
|
int |
readFully(byte[] arr)
Description of the Method
|
static int |
readInt(byte[] rd_buff,
int i)
Reads the integer value from the array at the offset.
|
static long |
readLong(byte[] rd_buff,
int i)
Reads the long-int value from the array at the offset.
|
void |
seek(long pos)
Description of the Method
|
String |
toString() |
close, readBoolean, readInt, readLong, readPack7, readPack7I, readShort, readString, readString, skipBytes, skipPack7, skipPack7I
public MemoryInputStream(byte[] buffer)
public MemoryInputStream(DataInput in, int size) throws IOException
IOException
public MemoryInputStream(byte[] buffer, int begin)
public MemoryInputStream(byte[] buffer, int begin, int end)
public int readFully(byte[] arr) throws IOException
DataInputStream
readFully
in interface DataInput
readFully
in class DataInputStream
arr
- Description of the ParameterIOException
- Description of the Exceptionpublic int read(byte[] arr, int offset, int max_len) throws IOException
read
in interface DataInput
read
in class DataInputStream
arr
- Description of the Parametermax_len
- Description of the ParameterIOException
- Description of the Exceptionpublic byte readByte() throws IOException
DataInputStream
readByte
in interface DataInput
readByte
in class DataInputStream
IOException
- Description of the Exceptionpublic int directRead(long from, byte[] arr) throws IOException
DataInput
directRead
in interface DataInput
directRead
in class DataInputStream
IOException
public void seek(long pos) throws IOException
DataInputStream
seek
in interface DataInput
seek
in class DataInputStream
pos
- Description of the ParameterIOException
- Description of the Exceptionpublic long length() throws IOException
DataInputStream
length
in interface DataInput
length
in class DataInputStream
IOException
- Description of the Exceptionpublic long getMarkPointer()
DataInput
getMarkPointer
in interface DataInput
getMarkPointer
in class DataInputStream
public void jump() throws IOException
jump
in interface DataInput
jump
in class DataInputStream
IOException
public void mark(long skip)
DataInput
DataInput.jump()
.mark
in interface DataInput
mark
in class DataInputStream
public long getFilePointer()
DataInputStream
getFilePointer
in interface DataInput
getFilePointer
in class DataInputStream
public static long readLong(byte[] rd_buff, int i)
public static int readInt(byte[] rd_buff, int i)
Copyright © 2016 Egothor. All Rights Reserved.