Package org.apache.commons.vfs2.provider
Class AbstractRandomAccessStreamContent
java.lang.Object
org.apache.commons.vfs2.provider.AbstractRandomAccessContent
org.apache.commons.vfs2.provider.AbstractRandomAccessStreamContent
- All Implemented Interfaces:
DataInput
,DataOutput
,RandomAccessContent
Implements the part usable for all stream-based random access.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract DataInputStream
Get the input stream.boolean
byte
readByte()
char
readChar()
double
float
void
readFully
(byte[] b) void
readFully
(byte[] b, int off, int len) int
readInt()
long
readLong()
short
int
int
readUTF()
void
setLength
(long newLength) Sets the length of this content.int
skipBytes
(int n) Methods inherited from class org.apache.commons.vfs2.provider.AbstractRandomAccessContent
readLine, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.vfs2.RandomAccessContent
close, getFilePointer, length, seek
-
Constructor Details
-
AbstractRandomAccessStreamContent
-
-
Method Details
-
getDataInputStream
- Throws:
IOException
-
readByte
- Throws:
IOException
-
readChar
- Throws:
IOException
-
readDouble
- Throws:
IOException
-
readFloat
- Throws:
IOException
-
readInt
- Throws:
IOException
-
readUnsignedByte
- Throws:
IOException
-
readUnsignedShort
- Throws:
IOException
-
readLong
- Throws:
IOException
-
readShort
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
skipBytes
- Throws:
IOException
-
readFully
- Throws:
IOException
-
readFully
- Throws:
IOException
-
readUTF
- Throws:
IOException
-
getInputStream
Description copied from interface:RandomAccessContent
Get the input stream.Notice: If you use
RandomAccessContent.seek(long)
you have to re-get the InputStream- Returns:
- the InputStream.
- Throws:
IOException
- if an I/O error occurs.
-
setLength
Description copied from interface:RandomAccessContent
Sets the length of this content.If the the
newLength
argument is smaller thanRandomAccessContent.length()
, the content is truncated.If the the
newLength
argument is greater thanRandomAccessContent.length()
, the content grows with undefined data.- Parameters:
newLength
- The desired content length- Throws:
IOException
- If an I/O error occurs
-