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
-
StructWalker(byte[])
- default: Little Endian
-
StructWalker(byte[], boolean)
-
-
StructWalker(byte[], int)
- default: Little Endian
-
StructWalker(byte[], int, boolean)
-
-
readByte()
-
-
readFixSizeString(int)
-
-
readFixSizeUnicode(int)
-
-
readFixSizeUnicodeCharArray(int)
-
-
readShort()
-
-
readUnsignedByte()
-
-
readUnsignedInt()
-
-
readUnsignedShort()
-
-
skipBytes(int)
-
-
writeFixSizeString(String, int, char)
-
-
writeFixSizeUnicode(String, int, int)
-
-
writeUnsignedByte(int)
-
-
writeUnsignedInt(long)
-
-
writeUnsignedShort(int)
-
StructWalker
public StructWalker(byte[] data)
- default: Little Endian
StructWalker
public StructWalker(byte[] data,
int ofs)
- default: Little Endian
StructWalker
public StructWalker(byte[] data,
boolean bigEndian)
StructWalker
public StructWalker(byte[] data,
int ofs,
boolean bigEndian)
- Parameters:
- data - the struct to walk
- ofs - the point to start
- bigEndian - mode selection
skipBytes
public void skipBytes(int n)
readByte
public byte readByte()
readUnsignedByte
public int readUnsignedByte()
writeUnsignedByte
public void writeUnsignedByte(int b)
readShort
public int readShort()
readUnsignedShort
public int readUnsignedShort()
writeUnsignedShort
public void writeUnsignedShort(int x)
readUnsignedInt
public long readUnsignedInt()
writeUnsignedInt
public void writeUnsignedInt(long x)
readFixSizeString
public String readFixSizeString(int len)
writeFixSizeString
public void writeFixSizeString(String s,
int len,
char padChar)
readFixSizeUnicode
public String readFixSizeUnicode(int len)
readFixSizeUnicodeCharArray
public char[] readFixSizeUnicodeCharArray(int len)
writeFixSizeUnicode
public void writeFixSizeUnicode(String s,
int start,
int len)
All Packages Class Hierarchy This Package Previous Next Index