|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.vfs.provider.ram.RamFileRandomAccessContent
RAM File Random Access Content
Field Summary | |
protected int |
filePointer
File Pointer |
Constructor Summary | |
RamFileRandomAccessContent(RamFileObject file,
RandomAccessMode mode)
|
Method Summary | |
void |
close()
Closes this random access file stream and releases any system resources associated with the stream. |
long |
getFilePointer()
Returns the current offset in this file. |
InputStream |
getInputStream()
get the input stream Notice: If you use seek(long) you have to reget the InputStream |
long |
length()
Returns the length of this file. |
boolean |
readBoolean()
|
byte |
readByte()
|
char |
readChar()
|
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
|
String |
readLine()
|
long |
readLong()
|
short |
readShort()
|
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
String |
readUTF()
|
void |
seek(long pos)
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. |
int |
skipBytes(int n)
|
static byte[] |
toBytes(long n,
byte[] b)
Build a 8-byte array from a long. |
static long |
toLong(byte[] b)
Build a long from first 8 bytes of the array. |
static short |
toShort(byte[] b)
Build a short from first 2 bytes of the array. |
static int |
toUnsignedShort(byte[] b)
Build a short from first 2 bytes of the array. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
void |
writeBoolean(boolean v)
|
void |
writeByte(int i)
|
void |
writeBytes(String s)
|
void |
writeChar(int v)
|
void |
writeChars(String s)
|
void |
writeDouble(double v)
|
void |
writeFloat(float v)
|
void |
writeInt(int v)
|
void |
writeLong(long v)
|
void |
writeShort(int v)
|
void |
writeUTF(String str)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int filePointer
Constructor Detail |
public RamFileRandomAccessContent(RamFileObject file, RandomAccessMode mode)
mode
- Method Detail |
public long getFilePointer() throws IOException
RandomAccessContent
getFilePointer
in interface RandomAccessContent
IOException
- if an I/O error occurs.public void seek(long pos) throws IOException
RandomAccessContent
RandomAccessContent.getInputStream()
you have to reget the InputStream after calling RandomAccessContent.seek(long)
seek
in interface RandomAccessContent
pos
- the offset position, measured in bytes from the
beginning of the file, at which to set the file
pointer.
IOException
- if pos
is less than
0
or if an I/O error occurs.public long length() throws IOException
RandomAccessContent
length
in interface RandomAccessContent
IOException
- if an I/O error occurs.public void close() throws IOException
RandomAccessContent
If this file has an associated channel then the channel is closed as well.
close
in interface RandomAccessContent
IOException
- if an I/O error occurs.public byte readByte() throws IOException
readByte
in interface DataInput
IOException
public char readChar() throws IOException
readChar
in interface DataInput
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public int readInt() throws IOException
readInt
in interface DataInput
IOException
public int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
public long readLong() throws IOException
readLong
in interface DataInput
IOException
public short readShort() throws IOException
readShort
in interface DataInput
IOException
public boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in interface DataOutput
IOException
public void write(byte[] b) throws IOException
write
in interface DataOutput
IOException
public void writeByte(int i) throws IOException
writeByte
in interface DataOutput
IOException
public static long toLong(byte[] b)
b
- The byte[] to convert.
public static byte[] toBytes(long n, byte[] b)
n
- The number to convert.b
- The array to fill.
public static short toShort(byte[] b)
b
- The byte[] to convert.
public static int toUnsignedShort(byte[] b)
b
- The byte[] to convert.
public void write(int b) throws IOException
write
in interface DataOutput
IOException
public void writeBoolean(boolean v) throws IOException
writeBoolean
in interface DataOutput
IOException
public void writeBytes(String s) throws IOException
writeBytes
in interface DataOutput
IOException
public void writeChar(int v) throws IOException
writeChar
in interface DataOutput
IOException
public void writeChars(String s) throws IOException
writeChars
in interface DataOutput
IOException
public void writeDouble(double v) throws IOException
writeDouble
in interface DataOutput
IOException
public void writeFloat(float v) throws IOException
writeFloat
in interface DataOutput
IOException
public void writeInt(int v) throws IOException
writeInt
in interface DataOutput
IOException
public void writeLong(long v) throws IOException
writeLong
in interface DataOutput
IOException
public void writeShort(int v) throws IOException
writeShort
in interface DataOutput
IOException
public void writeUTF(String str) throws IOException
writeUTF
in interface DataOutput
IOException
public String readLine() throws IOException
readLine
in interface DataInput
IOException
public InputStream getInputStream() throws IOException
RandomAccessContent
RandomAccessContent.seek(long)
you have to reget the InputStream
getInputStream
in interface RandomAccessContent
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |