org.apache.commons.vfs.provider.webdav
Class WebdavFileObject.WebdavRandomAccesContent

java.lang.Object
  extended byorg.apache.commons.vfs.provider.AbstractRandomAccessContent
      extended byorg.apache.commons.vfs.provider.webdav.WebdavFileObject.WebdavRandomAccesContent
All Implemented Interfaces:
DataInput, DataOutput, RandomAccessContent
Enclosing class:
WebdavFileObject

public static class WebdavFileObject.WebdavRandomAccesContent
extends AbstractRandomAccessContent


Field Summary
protected  long filePointer
           
 
Constructor Summary
protected WebdavFileObject.WebdavRandomAccesContent(WebdavFileObject fileObject, 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 inputstream interface
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()
           
 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)
           
 
Methods inherited from class org.apache.commons.vfs.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
 

Field Detail

filePointer

protected long filePointer
Constructor Detail

WebdavFileObject.WebdavRandomAccesContent

protected WebdavFileObject.WebdavRandomAccesContent(WebdavFileObject fileObject,
                                                    RandomAccessMode mode)
Method Detail

getFilePointer

public long getFilePointer()
                    throws IOException
Description copied from interface: RandomAccessContent
Returns the current offset in this file.

Returns:
the offset from the beginning of the file, in bytes, at which the next read or write occurs.
Throws:
IOException - if an I/O error occurs.

seek

public void seek(long pos)
          throws IOException
Description copied from interface: RandomAccessContent
Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. The offset may be set beyond the end of the file. Setting the offset beyond the end of the file does not change the file length. The file length will change only by writing after the offset has been set beyond the end of the file.
Notice: If you use RandomAccessContent.getInputStream() you have to reget the InputStream after calling RandomAccessContent.seek(long)

Parameters:
pos - the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.
Throws:
IOException - if pos is less than 0 or if an I/O error occurs.

close

public void close()
           throws IOException
Description copied from interface: RandomAccessContent
Closes this random access file stream and releases any system resources associated with the stream. A closed random access file cannot perform input or output operations and cannot be reopened.

If this file has an associated channel then the channel is closed as well.

Throws:
IOException - if an I/O error occurs.

length

public long length()
            throws IOException
Description copied from interface: RandomAccessContent
Returns the length of this file.

Returns:
the length of this file, measured in bytes.
Throws:
IOException - if an I/O error occurs.

readByte

public byte readByte()
              throws IOException
Throws:
IOException

readChar

public char readChar()
              throws IOException
Throws:
IOException

readDouble

public double readDouble()
                  throws IOException
Throws:
IOException

readFloat

public float readFloat()
                throws IOException
Throws:
IOException

readInt

public int readInt()
            throws IOException
Throws:
IOException

readUnsignedByte

public int readUnsignedByte()
                     throws IOException
Throws:
IOException

readUnsignedShort

public int readUnsignedShort()
                      throws IOException
Throws:
IOException

readLong

public long readLong()
              throws IOException
Throws:
IOException

readShort

public short readShort()
                throws IOException
Throws:
IOException

readBoolean

public boolean readBoolean()
                    throws IOException
Throws:
IOException

skipBytes

public int skipBytes(int n)
              throws IOException
Throws:
IOException

readFully

public void readFully(byte[] b)
               throws IOException
Throws:
IOException

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws IOException
Throws:
IOException

readUTF

public String readUTF()
               throws IOException
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: RandomAccessContent
get the inputstream interface
Notice: If you use RandomAccessContent.seek(long) you have to reget the InputStream

Returns:
Throws:
IOException


Copyright © 2002-2005 The Apache Software Foundation. All Rights Reserved.