com.sun.xml.stream
Class FileBufferManager
java.lang.Object
com.sun.xml.stream.BufferManager
com.sun.xml.stream.FileBufferManager
public class FileBufferManager
- extends BufferManager
- Author:
- Neeraj Bajaj, Sun Microsystems
Constructor Summary |
FileBufferManager(java.io.FileInputStream stream,
java.lang.String encodingName)
|
Method Summary |
boolean |
arrangeCapacity(int length)
xxx: This should be an abstract method because in StreamBufferManager
CharBuffer capacity doesn't grow |
void |
close()
|
java.nio.CharBuffer |
getCharBuffer()
|
boolean |
getMore()
This function returns true if some character data was loaded. |
java.nio.ByteBuffer |
getMoreBytes()
This function gets more data from the file. |
static void |
main(java.lang.String[] args)
|
void |
setEncoding(java.lang.String encoding)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileBufferManager
public FileBufferManager(java.io.FileInputStream stream,
java.lang.String encodingName)
throws java.io.IOException
- Throws:
java.io.IOException
arrangeCapacity
public boolean arrangeCapacity(int length)
throws java.io.IOException
- Description copied from class:
BufferManager
- xxx: This should be an abstract method because in StreamBufferManager
CharBuffer capacity doesn't grow
- Specified by:
arrangeCapacity
in class BufferManager
- Throws:
java.io.IOException
getMoreBytes
public java.nio.ByteBuffer getMoreBytes()
throws java.io.IOException
- This function gets more data from the file. If there is no more data a ByteBuffer of capacity 'zero'
is returned. This function always returns a new ByteBuffer.
- Throws:
java.io.IOException
getMore
public boolean getMore()
throws java.io.IOException
- This function returns true if some character data was loaded. Data is available via getCharBuffer().
If before calling this function CharBuffer had some data (i.e. remaining() > 0) then this function
first calls CharBuffer.compact() and then it is filled with more data.
- Specified by:
getMore
in class BufferManager
- Returns:
- true if some character data was loaded. False value can be assume to be end of current
entity.
- Throws:
java.io.IOException
- See Also:
CharBuffer.compact()
getCharBuffer
public java.nio.CharBuffer getCharBuffer()
- Specified by:
getCharBuffer
in class BufferManager
main
public static void main(java.lang.String[] args)
close
public void close()
throws java.io.IOException
- Specified by:
close
in class BufferManager
- Throws:
java.io.IOException
setEncoding
public void setEncoding(java.lang.String encoding)
throws java.io.IOException
- Specified by:
setEncoding
in class BufferManager
- Throws:
java.io.IOException
Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.