com.j256.simplemagic.types
Class PStringType

java.lang.Object
  extended by com.j256.simplemagic.types.StringType
      extended by com.j256.simplemagic.types.PStringType
All Implemented Interfaces:
MagicMatcher

public class PStringType
extends StringType

A Pascal-style string where the first byte is interpreted as the an unsigned length. The string is not '\0' terminated.

Author:
graywatson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.j256.simplemagic.types.StringType
StringType.StringTestInfo
 
Constructor Summary
PStringType()
           
 
Method Summary
 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

PStringType

public PStringType()
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.


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