org.mmbase.servlet
Class FileServlet.ChainedRange

Package class diagram package FileServlet.ChainedRange
java.lang.Object
  extended by org.mmbase.servlet.FileServlet.ChainedRange
All Implemented Interfaces:
FileServlet.Range
Enclosing class:
FileServlet

protected static class FileServlet.ChainedRange
extends Object
implements FileServlet.Range

This implementation of Range parses and combines a number of FileServlet.FirstLastRanges. So, this deals with the entire Range specification then.

Since:
MMBase-2.0

Field Summary
(package private)  long max
           
(package private)  List<FileServlet.Range> ranges
           
 
Constructor Summary
FileServlet.ChainedRange(String s, long max)
           
 
Method Summary
 long available(long i)
          If we are at byte number i, how many are available from here until we encounter one which isn't?
 long getLength()
           
 long notavailable(long i)
          If we are at byte number i, how many are not available from here until we encounter one which is?
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ranges

final List<FileServlet.Range> ranges

max

final long max
Constructor Detail

FileServlet.ChainedRange

FileServlet.ChainedRange(String s,
                         long max)
Method Detail

available

public long available(long i)
Description copied from interface: FileServlet.Range
If we are at byte number i, how many are available from here until we encounter one which isn't?

Specified by:
available in interface FileServlet.Range
Returns:
A number of bytes which are available, 0 if there are not bytes available. A large number near Long.MAX_VALUE if there is no limit any more.

notavailable

public long notavailable(long i)
Description copied from interface: FileServlet.Range
If we are at byte number i, how many are not available from here until we encounter one which is?

Specified by:
notavailable in interface FileServlet.Range
Returns:
Some number of bytes or 0 if the next character is available. A large number near Long.MAX_VALUE if all subsequent byes are unavailable.

getLength

public long getLength()

toString

public String toString()
Overrides:
toString in class Object


MMBase2 Resources 2.0-SNAPSHOT - 2014-09-22T23:09