|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.jme3.scene.plugins.blender.file.BlenderInputStream
public class BlenderInputStream
An input stream with random access to data.
Field Summary | |
---|---|
protected byte[] |
cachedBuffer
The buffer we store the read data to. |
protected java.io.InputStream |
inputStream
The input stream we read the data from. |
protected int |
position
The current position of the read cursor. |
protected int |
size
The total size of the stored data. |
Constructor Summary | |
---|---|
BlenderInputStream(java.io.InputStream inputStream,
AssetManager assetManager)
Constructor. |
Method Summary | |
---|---|
void |
alignPosition(int bytesAmount)
This method aligns cursor position forward to a given amount of bytes. |
void |
close()
|
AssetManager |
getAssetManager()
This method returns the application's asset manager. |
int |
getPointerSize()
This method returns the size of the pointer. |
int |
getPosition()
This method returns the position of the read cursor. |
java.lang.String |
getVersionNumber()
This method returns the blender version number where the file was created. |
int |
read()
|
int |
readByte()
This method reads 1 byte from the stream. |
double |
readDouble()
This method reads 8-byte floating point number (double) from the stream. |
float |
readFloat()
This method reads 4-byte floating point number (float) from the stream. |
int |
readInt()
This method reads 4-byte number from the stream. |
long |
readLong()
This method reads 8-byte number from the stream. |
long |
readPointer()
This method reads the pointer value. |
int |
readShort()
This method reads 2-byte number from the stream. |
java.lang.String |
readString()
This method reads the string. |
void |
setPosition(int position)
This method sets the current position of the read cursor. |
Methods inherited from class java.io.InputStream |
---|
available, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] cachedBuffer
protected int size
protected int position
protected java.io.InputStream inputStream
Constructor Detail |
---|
public BlenderInputStream(java.io.InputStream inputStream, AssetManager assetManager) throws BlenderFileException
inputStream
- the stream we read data fromassetManager
- the application's asset manager
BlenderFileException
- this exception is thrown if the file header has some invalid dataMethod Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int readByte()
public int readShort()
public int readInt()
public float readFloat()
public long readLong()
public double readDouble()
public long readPointer()
public java.lang.String readString()
public void setPosition(int position)
position
- the position of the read cursorpublic int getPosition()
public java.lang.String getVersionNumber()
public int getPointerSize()
public AssetManager getAssetManager()
public void alignPosition(int bytesAmount)
bytesAmount
- the byte amount to which we aligh the cursorpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |