phelps.io
public class ByteArrayRAF extends Object implements RandomAccess
byte[]
,
in the same way java.io.ByteArrayInputStream provides an InputStream interface.
Does not subclass java.io.RandomAccessFile because we want to use this class in restriced situations where reading of local files is not permitted and RAF always checks the readability of its file.
See Also: BufferedRandomAccessFile
Constructor Summary | |
---|---|
ByteArrayRAF(byte[] buf, String mode) | |
ByteArrayRAF(InputStream in, String mode)
Sets contents from remainder of in and closes in. |
Method Summary | |
---|---|
void | close() |
byte[] | getByteArray() |
long | getFilePointer() |
long | length() |
int | read(byte[] b) |
int | read(byte[] b, int off, int len) |
int | read() |
void | readFully(byte[] b) |
void | readFully(byte[] b, int off, int len) |
void | seek(long pos) |
void | setLength(long newLength) |
int | skipBytes(int n) |
void | write(byte[] b) |
void | write(byte[] b, int off, int len) |
void | write(int b) |
void | writeChar(char ch) |
void | writeString16(String s) |
void | writeString8(String s) |