All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class org.jos.util.StructWalker

java.lang.Object
    |
    +----org.jos.util.StructWalker

public final class StructWalker
extends Object
Utility class that parses/builds "structs"

Quite similar to a DataInputStream/DateOutputStream combination applied on a ByteArrayInputStream, but can work in little-endian or big-endian mode.

Version:
JOS-FileSystem 4 Preview (25-Mar-98)
Author:
Stefan Reich

Constructor Index

 o StructWalker(byte[])
default: Little Endian
 o StructWalker(byte[], boolean)
 o StructWalker(byte[], int)
default: Little Endian
 o StructWalker(byte[], int, boolean)

Method Index

 o readByte()
 o readFixSizeString(int)
 o readFixSizeUnicode(int)
 o readFixSizeUnicodeCharArray(int)
 o readShort()
 o readUnsignedByte()
 o readUnsignedInt()
 o readUnsignedShort()
 o skipBytes(int)
 o writeFixSizeString(String, int, char)
 o writeFixSizeUnicode(String, int, int)
 o writeUnsignedByte(int)
 o writeUnsignedInt(long)
 o writeUnsignedShort(int)

Constructors

 o StructWalker
public StructWalker(byte[] data)
default: Little Endian

 o StructWalker
public StructWalker(byte[] data,
                    int ofs)
default: Little Endian

 o StructWalker
public StructWalker(byte[] data,
                    boolean bigEndian)
 o StructWalker
public StructWalker(byte[] data,
                    int ofs,
                    boolean bigEndian)
Parameters:
data - the struct to walk
ofs - the point to start
bigEndian - mode selection

Methods

 o skipBytes
public void skipBytes(int n)
 o readByte
public byte readByte()
 o readUnsignedByte
public int readUnsignedByte()
 o writeUnsignedByte
public void writeUnsignedByte(int b)
 o readShort
public int readShort()
 o readUnsignedShort
public int readUnsignedShort()
 o writeUnsignedShort
public void writeUnsignedShort(int x)
 o readUnsignedInt
public long readUnsignedInt()
 o writeUnsignedInt
public void writeUnsignedInt(long x)
 o readFixSizeString
public String readFixSizeString(int len)
 o writeFixSizeString
public void writeFixSizeString(String s,
                               int len,
                               char padChar)
 o readFixSizeUnicode
public String readFixSizeUnicode(int len)
 o readFixSizeUnicodeCharArray
public char[] readFixSizeUnicodeCharArray(int len)
 o writeFixSizeUnicode
public void writeFixSizeUnicode(String s,
                                int start,
                                int len)

All Packages  Class Hierarchy  This Package  Previous  Next  Index