org.ogre4j
Class ZipDataStream

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.ZipDataStream
All Implemented Interfaces:
IAllocatedObject<IGeneralAllocPolicy>, IDataStream, IGeneralAllocatedObject, IZipDataStream, INativeObject

public class ZipDataStream
extends NativeObject
implements IZipDataStream


Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  ZipDataStream(InstancePointer p)
          This constructor is public for internal useage only!
protected ZipDataStream(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  ZipDataStream(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void close()
          Close the stream; this makes further operations invalid.
 void delete()
          Deletes the corresponding C++ object.
 boolean eof()
          Returns true if the stream has reached the end.
 void finalize()
           
 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 class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

ZipDataStream

public ZipDataStream(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


ZipDataStream

protected ZipDataStream(InstancePointer p,
                        boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


ZipDataStream

public ZipDataStream(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

read

public int read(VoidPointer buf,
                int count)
Description copied from interface: IDataStream
Read the requisite number of bytes from the stream, stopping at the end of the file.

Specified by:
read in interface IDataStream
Specified by:
read in interface IZipDataStream

skip

public void skip(long count)
Description copied from interface: IDataStream
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.

Specified by:
skip in interface IDataStream
Specified by:
skip in interface IZipDataStream

seek

public void seek(int pos)
Description copied from interface: IDataStream
Repositions the read point to a specified byte.

Specified by:
seek in interface IDataStream
Specified by:
seek in interface IZipDataStream

tell

public int tell()
Description copied from interface: IDataStream
Returns the current byte offset from beginning

Specified by:
tell in interface IDataStream
Specified by:
tell in interface IZipDataStream

eof

public boolean eof()
Description copied from interface: IDataStream
Returns true if the stream has reached the end.

Specified by:
eof in interface IDataStream
Specified by:
eof in interface IZipDataStream

close

public void close()
Description copied from interface: IDataStream
Close the stream; this makes further operations invalid.

Specified by:
close in interface IDataStream
Specified by:
close in interface IZipDataStream

getName

public java.lang.String getName()
Specified by:
getName in interface IDataStream

readLine

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

Specified by:
readLine in interface IDataStream

getLine

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

Specified by:
getLine in interface IDataStream

getAsString

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

Specified by:
getAsString in interface IDataStream

skipLine

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

Specified by:
skipLine in interface IDataStream

size

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

Specified by:
size in interface IDataStream


Copyright © 2007 netAllied GmbH. All Rights Reserved.