Package com.oss.util
Class BERTool.HexBuilder
java.lang.Object
com.oss.util.BERTool.HexBuilder
- All Implemented Interfaces:
BERTool.DumpBuilder
- Enclosing class:
- BERTool
Implements a BER encoding dump in hexadecimal-TLV format.
-
Constructor Summary
ConstructorDescriptionHexBuilder
(PrintStream sink) Constructs a new hexadecimal-TLV dump builder, which is used to dump data from a specified byte buffer source to a specified print stream sink. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked when a BER encoding processing starts, before any other method invocations.void
content
(ByteBuffer data) Invoked when primitive contents octets are parsed.void
Invoked when a constructed encoding ends.void
end_dump()
Invoked when a BER encoding processing ends, before returning control to the caller.void
eoc
(ByteBuffer data) Invoked when END-OF-CONTENTS octets are detected.void
error
(ByteBuffer data, String message) Invoked when an error occurs.int
Gets the value of the indent width.int
Gets the value of truncationLimit.void
length
(ByteBuffer data, int length) Invoked when a length is parsed.setIndentWidth
(int indentWidth) Sets the value of the indent width.setTruncationLimit
(int truncationLimit) Sets the value of truncationLimit.void
skip
(ByteBuffer data) Invoked when a misencoded value is skipped.void
tag
(ByteBuffer data, BERTool.Tag tag) Invoked when a tag is parsed.
-
Constructor Details
-
HexBuilder
Constructs a new hexadecimal-TLV dump builder, which is used to dump data from a specified byte buffer source to a specified print stream sink.- Parameters:
sink
- the value of sink.
-
-
Method Details
-
getTruncationLimit
public int getTruncationLimit()Gets the value of truncationLimit.- Returns:
- the value of truncationLimit.
-
setTruncationLimit
Sets the value of truncationLimit. Setting truncationLimit to zero or to a negative value disables truncation.- Parameters:
truncationLimit
- the new value of truncationLimit.- Returns:
- this object.
-
getIndentWidth
public int getIndentWidth()Gets the value of the indent width.- Returns:
- the value of the indent width.
-
setIndentWidth
Sets the value of the indent width.- Parameters:
indentWidth
- the new value of the indent width.- Returns:
- this object.
-
tag
Description copied from interface:BERTool.DumpBuilder
Invoked when a tag is parsed.- Specified by:
tag
in interfaceBERTool.DumpBuilder
- Parameters:
data
- theByteBuffer
object that contains BER bytes that represent a tag encoding. The encoding is delimited by theposition
andlimit
properties of theByteBuffer
.tag
- the decoded tag.
-
length
Description copied from interface:BERTool.DumpBuilder
Invoked when a length is parsed.- Specified by:
length
in interfaceBERTool.DumpBuilder
- Parameters:
data
- theByteBuffer
object that contains BER bytes that represent a length encoding. The encoding is delimited by theposition
andlimit
properties of theByteBuffer
.length
- the decoded length or -1 for indefinite length encodings.
-
eoc
Description copied from interface:BERTool.DumpBuilder
Invoked when END-OF-CONTENTS octets are detected.- Specified by:
eoc
in interfaceBERTool.DumpBuilder
- Parameters:
data
- theByteBuffer
object that contains BER bytes that represent the EOC. The EOC bytes are delimited by theposition
andlimit
properties of theByteBuffer
.
-
content
Description copied from interface:BERTool.DumpBuilder
Invoked when primitive contents octets are parsed.- Specified by:
content
in interfaceBERTool.DumpBuilder
- Parameters:
data
- theByteBuffer
object that contains BER bytes that represent primitive content octets. The primitive contents octets are delimited by theposition
andlimit
properties of theByteBuffer
.
-
skip
Description copied from interface:BERTool.DumpBuilder
Invoked when a misencoded value is skipped.- Specified by:
skip
in interfaceBERTool.DumpBuilder
- Parameters:
data
- theByteBuffer
object that contains BER bytes that are skipped. The bytes are delimited by theposition
andlimit
properties of theByteBuffer
.
-
error
Description copied from interface:BERTool.DumpBuilder
Invoked when an error occurs.- Specified by:
error
in interfaceBERTool.DumpBuilder
- Parameters:
data
- theByteBuffer
object that contains erroneous BER data. Theposition
property specifies the position of the error in the encoded data.message
- the error message.
-
end_constructed
public void end_constructed()Description copied from interface:BERTool.DumpBuilder
Invoked when a constructed encoding ends.- Specified by:
end_constructed
in interfaceBERTool.DumpBuilder
-
begin_dump
public void begin_dump()Description copied from interface:BERTool.DumpBuilder
Invoked when a BER encoding processing starts, before any other method invocations.- Specified by:
begin_dump
in interfaceBERTool.DumpBuilder
-
end_dump
public void end_dump()Description copied from interface:BERTool.DumpBuilder
Invoked when a BER encoding processing ends, before returning control to the caller.- Specified by:
end_dump
in interfaceBERTool.DumpBuilder
-