Emini Physics Engine 1.3.5a API Documentation

at.emini.physics2D.util
Class PhysicsFileReader

java.lang.Object
  extended by at.emini.physics2D.util.PhysicsFileReader

public class PhysicsFileReader
extends java.lang.Object

Wrapper for an InputStream. Features convenience methods to convert read bits.

Author:
Alexander Adensamer

Constructor Summary
PhysicsFileReader(java.io.InputStream stream)
          COnstructor using an input stream.
PhysicsFileReader(java.lang.String name)
          Constructor.
 
Method Summary
 void close()
          Closes the stream.
 int getVersion()
          Gets the version of the data stream.
 int next()
          Reads the next byte.
 int nextInt()
          Reads the next int (4 byte).
 float nextInt2FX()
          Read the next int (4 byte, 2FX).
 float nextIntFX()
          Read the next int (4 byte, FX).
 java.lang.String nextString()
          Reads the next string.
 FXVector nextVector()
          Reads the next vector : 4 + 4 bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhysicsFileReader

public PhysicsFileReader(java.lang.String name)
Constructor. Uses the J2ME resource loading mechanism.

Parameters:
name - the name of the file resource.

PhysicsFileReader

public PhysicsFileReader(java.io.InputStream stream)
COnstructor using an input stream.

Parameters:
stream - the data stream.
Method Detail

getVersion

public int getVersion()
Gets the version of the data stream.

Returns:
the version of the data stream.

next

public int next()
Reads the next byte.

Returns:
the next byte in the stream.

nextString

public java.lang.String nextString()
Reads the next string. The first 4 bytes indicate the length. The following bytes indicate the string characters encoded in UTF-8.

Returns:
the next bytes read as string.

nextInt

public int nextInt()
Reads the next int (4 byte).

Returns:
the next int of the stream (4 bytes).

nextIntFX

public float nextIntFX()
Read the next int (4 byte, FX). The method is required for the float conversion.

Returns:
the next int of the stream (4 bytes)

nextInt2FX

public float nextInt2FX()
Read the next int (4 byte, 2FX). The method is required for the float conversion to distinguish values stored in fx and 2fx

Returns:
the next int of the stream (4 bytes)

nextVector

public FXVector nextVector()
Reads the next vector : 4 + 4 bytes.

Returns:
the next 2d vector (4 + 4 bytes) in the stream.

close

public void close()
Closes the stream.


Emini Physics Engine 1.3.5a API Documentation

Emini Physics Engine 1.3.5a API Documentation - Copyright 2014 Alexander Adensamer