com.j256.simplemagic.types
Class BigEndianString16Type

java.lang.Object
  extended by com.j256.simplemagic.types.StringType
      extended by com.j256.simplemagic.types.BigEndianString16Type
All Implemented Interfaces:
MagicMatcher
Direct Known Subclasses:
LittleEndianString16Type

public class BigEndianString16Type
extends StringType

A two-byte unicode (UCS16) string in big-endian byte order.

Author:
graywatson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.j256.simplemagic.types.StringType
StringType.StringTestInfo
 
Constructor Summary
BigEndianString16Type()
           
 
Method Summary
protected  char bytesToChar(int firstByte, int secondByte)
           
 Object extractValueFromBytes(int offset, byte[] bytes)
          Extract the value from the bytes.
 
Methods inherited from class com.j256.simplemagic.types.StringType
convertTestString, findOffsetMatch, isMatch, renderValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigEndianString16Type

public BigEndianString16Type()
Method Detail

extractValueFromBytes

public Object extractValueFromBytes(int offset,
                                    byte[] bytes)
Description copied from interface: MagicMatcher
Extract the value from the bytes.

Specified by:
extractValueFromBytes in interface MagicMatcher
Overrides:
extractValueFromBytes in class StringType
Returns:
The object to be passed to MagicMatcher.isMatch(Object, Long, boolean, Object, int, byte[]) or null if not enough bytes.

bytesToChar

protected char bytesToChar(int firstByte,
                           int secondByte)


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.