nwnintf.format
Class Prim

java.lang.Object
  |
  +--nwnintf.format.Prim

public class Prim
extends java.lang.Object

Provide static methods for decoding types from bytes.


Constructor Summary
Prim()
           
 
Method Summary
static int int32lsb(byte[] bytes, int offset)
           
static int int32lsb(byte b1, byte b2, byte b3, byte b4)
           
static int int32lsb(java.io.RandomAccessFile f)
           
static long int64lsb(byte[] bytes, int offset)
           
static void main(java.lang.String[] args)
           
static java.lang.String string(byte[] bytes, int offset, int length)
           
static java.lang.String string(java.io.RandomAccessFile f, int length)
           
static java.lang.String string0(byte[] bytes, int offset, int length)
          Return a string of a given length, but stopping at null character.
static java.lang.String string0(java.io.RandomAccessFile f, int length)
          Read length bytes but return value stops at null byte.
static int uint16lsb(byte[] bytes, int offset)
          This returns int so that it can encompass the whole range of uint16.
static int uint8(byte[] bytes, int offset)
          This returns int so that it can encompass the whole range of uint8.
static void writeBytes0(java.io.RandomAccessFile f, java.lang.String x, int len)
           
static void writeIntLSB(java.io.RandomAccessFile f, int x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Prim

public Prim()
Method Detail

int32lsb

public static int int32lsb(byte b1,
                           byte b2,
                           byte b3,
                           byte b4)

int32lsb

public static int int32lsb(byte[] bytes,
                           int offset)

int64lsb

public static long int64lsb(byte[] bytes,
                            int offset)

uint8

public static int uint8(byte[] bytes,
                        int offset)
This returns int so that it can encompass the whole range of uint8. Could return short too, but whatever.


uint16lsb

public static int uint16lsb(byte[] bytes,
                            int offset)
This returns int so that it can encompass the whole range of uint16.


string0

public static java.lang.String string0(byte[] bytes,
                                       int offset,
                                       int length)
Return a string of a given length, but stopping at null character.


string

public static java.lang.String string(byte[] bytes,
                                      int offset,
                                      int length)

main

public static void main(java.lang.String[] args)

string

public static java.lang.String string(java.io.RandomAccessFile f,
                                      int length)
                               throws java.io.IOException
java.io.IOException

string0

public static java.lang.String string0(java.io.RandomAccessFile f,
                                       int length)
                                throws java.io.IOException
Read length bytes but return value stops at null byte.

java.io.IOException

int32lsb

public static int int32lsb(java.io.RandomAccessFile f)
                    throws java.io.IOException
java.io.IOException

writeIntLSB

public static void writeIntLSB(java.io.RandomAccessFile f,
                               int x)
                        throws java.io.IOException
java.io.IOException

writeBytes0

public static void writeBytes0(java.io.RandomAccessFile f,
                               java.lang.String x,
                               int len)
                        throws java.io.IOException
java.io.IOException