Package org.deepjava.runtime.util
Class ByteLiFo
- java.lang.Object
-
- org.deepjava.runtime.util.ByteLiFo
-
public class ByteLiFo extends Object
Non thread-save last in first outbyte
queue.
-
-
Constructor Summary
Constructors Constructor Description ByteLiFo(int size)
Creates a newByteLifo
withsize
entries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
availToRead()
Reads the available entries in the queue.void
clear()
Clears the LiFo.boolean
compare(byte[] cData, int lifoOffset, int length)
Compares the LiFo with abyte array
.byte
pop()
Removes onebyte
from the LiFo.void
push(byte d)
Inserts onebyte
into the LiFo.
-
-
-
Method Detail
-
push
public void push(byte d)
Inserts onebyte
into the LiFo.- Parameters:
d
-Byte
which will be inserted into the LiFo
-
pop
public byte pop()
Removes onebyte
from the LiFo.- Returns:
- The removed byte
-
clear
public void clear()
Clears the LiFo.
-
availToRead
public int availToRead()
Reads the available entries in the queue.- Returns:
- The available
bytes
to read.
-
compare
public boolean compare(byte[] cData, int lifoOffset, int length)
Compares the LiFo with abyte array
.- Parameters:
cData
- The byte array to compare with the LiFolifoOffset
- The start offset of the LiFolength
- The length ofcData
- Returns:
- true if
cData
and the LiFo are equal, false otherwise
-
-