com.imagero.uio.buffer
Class HTTPBuffer

java.lang.Object
  extended bycom.imagero.uio.buffer.HTTPBuffer
All Implemented Interfaces:
Buffer

public class HTTPBuffer
extends java.lang.Object
implements Buffer

Implementation of Buffer for http. This intelligent Buffer uses "byteserving" feature of HTTP 1.1 for reading only data which is needed.


Constructor Summary
HTTPBuffer(java.net.URL url, int offset, int length)
           
 
Method Summary
 byte[] getData()
          read specified part of data from URL
 byte[] getData(byte[] d)
          copy data to supplied byte array
 boolean isDirty()
           
 int length()
          get length of data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPBuffer

public HTTPBuffer(java.net.URL url,
                  int offset,
                  int length)
Method Detail

getData

public byte[] getData()
               throws java.io.IOException
read specified part of data from URL

Specified by:
getData in interface Buffer
Returns:
data
Throws:
java.io.IOException - if server don't support "byteserving"

getData

public byte[] getData(byte[] d)
               throws java.io.IOException
Description copied from interface: Buffer
copy data to supplied byte array

Specified by:
getData in interface Buffer
Parameters:
d - destination array
Returns:
byte array
Throws:
java.io.IOException

length

public int length()
Description copied from interface: Buffer
get length of data

Specified by:
length in interface Buffer
Returns:
length of data

isDirty

public boolean isDirty()
Specified by:
isDirty in interface Buffer