org.millscript.office.endianness
Class BigEndianDecoder

java.lang.Object
  extended by org.millscript.office.endianness.EndianDecoder
      extended by org.millscript.office.endianness.BigEndianDecoder

public class BigEndianDecoder
extends EndianDecoder

This class provides support for reading information stored with a big endian byte order.


Field Summary
static BigEndianDecoder DECODER
           
 
Constructor Summary
BigEndianDecoder()
           
 
Method Summary
 long decode8ByteLong(byte[] bytes, int offset)
          Reads 8 bytes of information from given offset(i.e.
 int decodeInt(byte byte1, byte byte2)
          Returns the integer value resulting from decoding the specified bytes as an integer.
 int decodeInt(byte b1, byte b2, byte b3, byte b4)
          Returns the integer value resulting from decoding the specified bytes as an integer.
 
Methods inherited from class org.millscript.office.endianness.EndianDecoder
decode2ByteChar, decode2ByteInt, decode4ByteInt, decodeChar, decodeInt, decodeInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DECODER

public static final BigEndianDecoder DECODER
Constructor Detail

BigEndianDecoder

public BigEndianDecoder()
Method Detail

decode8ByteLong

public long decode8ByteLong(byte[] bytes,
                            int offset)
Description copied from class: EndianDecoder
Reads 8 bytes of information from given offset(i.e. zero based index) into the specified byte array, decodes them and return the long value.

Specified by:
decode8ByteLong in class EndianDecoder
Parameters:
bytes - the byte array to decode an int from
offset - the offset(zero based index) into the byte array to
Returns:
the long value of the 8 bytes at the specified position
See Also:
EndianDecoder.decode8ByteLong(byte[], int)

decodeInt

public int decodeInt(byte byte1,
                     byte byte2)
Description copied from class: EndianDecoder
Returns the integer value resulting from decoding the specified bytes as an integer.

Specified by:
decodeInt in class EndianDecoder
Parameters:
byte1 - the first byte in the stream
byte2 - the second byte in the stream
Returns:
the integer value resulting from decoding the given bytes
See Also:
EndianDecoder.decodeInt(byte, byte)

decodeInt

public int decodeInt(byte b1,
                     byte b2,
                     byte b3,
                     byte b4)
Description copied from class: EndianDecoder
Returns the integer value resulting from decoding the specified bytes as an integer.

Specified by:
decodeInt in class EndianDecoder
Parameters:
b1 - the first byte in the stream
b2 - the second byte in the stream
b3 - the third byte in the stream
b4 - the fourth byte in the stream
Returns:
the integer value resulting from decoding the given bytes
See Also:
EndianDecoder.decodeInt(byte, byte, byte, byte)


Copyright © 2006-2007 Open World Ltd. All Rights Reserved.