public class Asn1Buffer extends Object
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
buffer
A buffer to store the encoded PDU
|
private static int |
DEFAULT_SIZE
The buffer default size
|
private int |
pos
The current position in the buffer
|
| Constructor and Description |
|---|
Asn1Buffer()
Creates a new Asn1Buffer instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the position, emptying the buffer.
|
private void |
extend(int size)
Extend the buffer
|
ByteBuffer |
getBytes() |
int |
getPos() |
int |
getSize() |
void |
put(byte b)
Store a byte at the current position in the buffer
|
void |
put(byte[] bytes)
Store some bytes at the current position in the buffer
|
void |
setPos(int pos)
Set the current position in the buffer
|
String |
toString() |
private static final int DEFAULT_SIZE
private int pos
private byte[] buffer
public int getPos()
public void setPos(int pos)
pos - The position to move the buffer topublic void put(byte b)
b - The byte to storepublic void put(byte[] bytes)
bytes - The bytes to storeprivate void extend(int size)
size - The new buffer sizepublic ByteBuffer getBytes()
public int getSize()
public void clear()
Copyright © 2003–2023 The Apache Software Foundation. All rights reserved.