org.ogre4j
Interface IDataStream

All Superinterfaces:
IAllocatedObject<IGeneralAllocPolicy>, IGeneralAllocatedObject, INativeObject
All Known Subinterfaces:
IFileHandleDataStream, IFileStreamDataStream, IMemoryDataStream, IZipDataStream
All Known Implementing Classes:
DataStream, FileHandleDataStream, FileStreamDataStream, MemoryDataStream, ZipDataStream

public interface IDataStream
extends INativeObject, IGeneralAllocatedObject


Method Summary
 void close()
          Close the stream; this makes further operations invalid.
 boolean eof()
          Returns true if the stream has reached the end.
 java.lang.String getAsString()
          Returns a String containing the entire stream.
 java.lang.String getLine(boolean trimAfter)
          Returns a String containing the next line of data, optionally trimmed for whitespace.
 java.lang.String getName()
           
 int read(VoidPointer buf, int count)
          Read the requisite number of bytes from the stream, stopping at the end of the file.
 int readLine(BytePointer buf, int maxCount, java.lang.String delim)
          Get a single line from the stream.
 void seek(int pos)
          Repositions the read point to a specified byte.
 int size()
          Returns the total size of the data to be read from the stream, or 0 if this is indeterminate for this stream.
 void skip(long count)
          Skip a defined number of bytes.
 int skipLine(java.lang.String delim)
          Skip a single line from the stream.
 int tell()
          Returns the current byte offset from beginning
 
Methods inherited from interface org.xbig.base.INativeObject
delete, disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Method Detail

getName

java.lang.String getName()

read

int read(VoidPointer buf,
         int count)
Read the requisite number of bytes from the stream, stopping at the end of the file.


readLine

int readLine(BytePointer buf,
             int maxCount,
             java.lang.String delim)
Get a single line from the stream.


getLine

java.lang.String getLine(boolean trimAfter)
Returns a String containing the next line of data, optionally trimmed for whitespace.


getAsString

java.lang.String getAsString()
Returns a String containing the entire stream.


skipLine

int skipLine(java.lang.String delim)
Skip a single line from the stream.


skip

void skip(long count)
Skip a defined number of bytes. This can also be a negative value, in which case the file pointer rewinds a defined number of bytes.


seek

void seek(int pos)
Repositions the read point to a specified byte.


tell

int tell()
Returns the current byte offset from beginning


eof

boolean eof()
Returns true if the stream has reached the end.


size

int size()
Returns the total size of the data to be read from the stream, or 0 if this is indeterminate for this stream.


close

void close()
Close the stream; this makes further operations invalid.



Copyright © 2007 netAllied GmbH. All Rights Reserved.