public class MemoryInputStream extends AbstractDataInput implements java.io.DataInput
Constructor and Description |
---|
MemoryInputStream(Memory mem) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getPosition() |
long |
getPositionLimit() |
protected long |
length() |
int |
read() |
void |
readFully(byte[] buffer,
int offset,
int count)
Read bytes from this file into
buffer starting at offset offset . |
void |
seek(long pos) |
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
available, mark, markSupported, read, read, reset, skip
public MemoryInputStream(Memory mem)
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void readFully(byte[] buffer, int offset, int count) throws java.io.IOException
AbstractDataInput
buffer
starting at offset offset
. This method blocks until count
number of bytes have been
read.readFully
in interface java.io.DataInput
readFully
in class AbstractDataInput
buffer
- the buffer to read bytes into.offset
- the initial position in buffer
to store the bytes read
from this file.count
- the maximum number of bytes to store in buffer
.java.io.EOFException
- if the end of this file is detected.java.io.IOException
- if this file is closed or another I/O error occurs.public void seek(long pos)
seek
in class AbstractDataInput
public long getPosition()
getPosition
in class AbstractDataInput
public long getPositionLimit()
getPositionLimit
in class AbstractDataInput
protected long length()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
Copyright © 2018 The Apache Software Foundation