Package org.ldaptive.transport.netty
Class NettyDERBuffer
- java.lang.Object
-
- org.ldaptive.transport.netty.NettyDERBuffer
-
-
Field Summary
Fields Modifier and Type Field Description private io.netty.buffer.ByteBuf
buffer
Underlying byte buffer.
-
Constructor Summary
Constructors Constructor Description NettyDERBuffer(io.netty.buffer.ByteBuf buf)
Creates a new netty DER buffer.NettyDERBuffer(io.netty.buffer.ByteBuf buf, int pos, int lim)
Creates a new netty DER buffer and sets the initial position and limit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
capacity()
Returns this buffer's capacity.DERBuffer
clear()
Sets the position to zero and the limit to the capacity.byte
get()
Relative get method.DERBuffer
get(byte[] dst)
Relative bulk get method.int
limit()
Returns this buffer's limit.DERBuffer
limit(int newLimit)
Sets this buffer's limit.int
position()
Returns this buffer's position.DERBuffer
position(int newPosition)
Sets this buffer's position.DERBuffer
slice()
Creates a new DER buffer whose content is a shared sub-sequence of this buffer's content.String
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
-
-
-
-
Constructor Detail
-
NettyDERBuffer
NettyDERBuffer(io.netty.buffer.ByteBuf buf)
Creates a new netty DER buffer.- Parameters:
buf
- existing byte buf
-
NettyDERBuffer
NettyDERBuffer(io.netty.buffer.ByteBuf buf, int pos, int lim)
Creates a new netty DER buffer and sets the initial position and limit.- Parameters:
buf
- existing byte bufpos
- initial buffer positionlim
- initial buffer limit
-
-
Method Detail
-
position
public int position()
Description copied from interface:DERBuffer
Returns this buffer's position.
-
position
public DERBuffer position(int newPosition)
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
public DERBuffer limit(int newLimit)
Description copied from interface:DERBuffer
Sets this buffer's limit.
-
clear
public DERBuffer 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
public DERBuffer get(byte[] dst)
Description copied from interface:DERBuffer
Relative bulk get method.
-
slice
public DERBuffer 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.
-
-