Package com.jackmeng.stl
Class stl_CircularBuffer
java.lang.Object
com.jackmeng.stl.stl_CircularBuffer
public class stl_CircularBuffer
extends java.lang.Object
-
Field Summary
-
Constructor Summary
Constructors Constructor Description stl_CircularBuffer()stl_CircularBuffer(int init_Size) -
Method Summary
Modifier and Type Method Description private static intcalc_offset(int len_0, int sz, int buff_len)voiddrop(int elementsCount)intfree(int n)intfree_sz()voidinit()voidnext(int n)intoffset()voidopush(byte[] data, int i, int len)booleanoverflows(int n)intpeek(byte[] data, int i, int len)voidpeek(stl_Callback<java.lang.Void,java.nio.ByteBuffer> e)intpop(byte[] bytes, int i, int len)intpush(byte[] data, int i, int len)inttotal_sz()intused_sz()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
buffer
private final byte[] buffer -
start
private int start -
sz
private int sz
-
-
Constructor Details
-
stl_CircularBuffer
public stl_CircularBuffer(int init_Size) -
stl_CircularBuffer
public stl_CircularBuffer()
-
-
Method Details
-
used_sz
public int used_sz() -
total_sz
public int total_sz() -
free_sz
public int free_sz() -
drop
public void drop(int elementsCount) -
push
public int push(byte[] data, int i, int len) -
opush
public void opush(byte[] data, int i, int len) -
init
public void init() -
calc_offset
private static int calc_offset(int len_0, int sz, int buff_len) -
offset
public int offset() -
peek
-
peek
public int peek(byte[] data, int i, int len) -
pop
public int pop(byte[] bytes, int i, int len) -
overflows
public boolean overflows(int n) -
next
public void next(int n) -
free
public int free(int n)
-