Package org.ldaptive.asn1
Class DefaultDERBuffer
java.lang.Object
org.ldaptive.asn1.DefaultDERBuffer
- All Implemented Interfaces:
DERBuffer
DERBuffer
that uses a ByteBuffer
.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDERBuffer
(byte[] array) Creates a new default DER buffer.DefaultDERBuffer
(int capacity) Creates a new default DER buffer.Creates a new default DER buffer.DefaultDERBuffer
(ByteBuffer buf, int pos, int lim) Creates a new default DER buffer and sets the initial position and limit. -
Method Summary
Modifier and TypeMethodDescriptionint
capacity()
Returns this buffer's capacity.clear()
Sets the position to zero and the limit to the capacity.byte
get()
Relative get method.get
(byte[] dst) Relative bulk get method.int
limit()
Returns this buffer's limit.limit
(int newLimit) Sets this buffer's limit.int
position()
Returns this buffer's position.position
(int newPosition) Sets this buffer's position.slice()
Creates a new DER buffer whose content is a shared sub-sequence of this buffer's content.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ldaptive.asn1.DERBuffer
getRemainingBytes, hasRemaining, remaining
-
Field Details
-
buffer
Underlying byte buffer.
-
-
Constructor Details
-
DefaultDERBuffer
public DefaultDERBuffer(int capacity) Creates a new default DER buffer. SeeByteBuffer.allocate(int)
.- Parameters:
capacity
- of this buffer
-
DefaultDERBuffer
public DefaultDERBuffer(byte[] array) Creates a new default DER buffer. SeeByteBuffer.wrap(byte[])
.- Parameters:
array
- contents of the buffer
-
DefaultDERBuffer
Creates a new default DER buffer.- Parameters:
buf
- existing byte buffer
-
DefaultDERBuffer
Creates a new default DER buffer and sets the initial position and limit.- Parameters:
buf
- existing byte bufferpos
- initial buffer positionlim
- initial buffer limit
-
-
Method Details
-
position
public int position()Description copied from interface:DERBuffer
Returns this buffer's position. -
position
Description copied from interface:DERBuffer
Sets this buffer's position. -
limit
public int limit()Description copied from interface:DERBuffer
Returns this buffer's limit. -
capacity
public int capacity()Description copied from interface:DERBuffer
Returns this buffer's capacity. -
limit
Description copied from interface:DERBuffer
Sets this buffer's limit. -
clear
Description copied from interface:DERBuffer
Sets the position to zero and the limit to the capacity.This method does not actually erase the data in the buffer.
-
get
public byte get()Description copied from interface:DERBuffer
Relative get method. Reads the byte at this buffer's current position and then increments the position. -
get
Description copied from interface:DERBuffer
Relative bulk get method. -
slice
Description copied from interface:DERBuffer
Creates a new DER buffer whose content is a shared sub-sequence of this buffer's content.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position and limit will be independent.
The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer.
-
toString
-