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 int
calc_offset(int len_0, int sz, int buff_len)
void
drop(int elementsCount)
int
free(int n)
int
free_sz()
void
init()
void
next(int n)
int
offset()
void
opush(byte[] data, int i, int len)
boolean
overflows(int n)
int
peek(byte[] data, int i, int len)
void
peek(stl_Callback<java.lang.Void,java.nio.ByteBuffer> e)
int
pop(byte[] bytes, int i, int len)
int
push(byte[] data, int i, int len)
int
total_sz()
int
used_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)
-