Package com.pi4j.io.serial.impl
Class SerialByteBuffer
- java.lang.Object
-
- com.pi4j.io.serial.impl.SerialByteBuffer
-
public class SerialByteBuffer extends Object
This class implements a dynamic expanding byte buffer to accommodate new data received from the serial port Adapted from sources at: http://ostermiller.org/utils/src/CircularByteBuffer.java.html Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SerialByteBuffer.SerialByteBufferInputStream
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BUFFER_SCALE_FACTOR
static int
DEFAULT_INITIAL_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description SerialByteBuffer()
SerialByteBuffer(int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
int
capacity()
void
clear()
InputStream
getInputStream()
int
remaining()
void
write(byte[] data)
void
write(byte[] data, int offset, int length)
-
-
-
Method Detail
-
clear
public void clear()
-
getInputStream
public InputStream getInputStream()
-
capacity
public int capacity()
-
remaining
public int remaining()
-
available
public int available()
-
write
public void write(byte[] data) throws IOException, BufferOverflowException
- Throws:
IOException
BufferOverflowException
-
write
public void write(byte[] data, int offset, int length) throws IOException
- Throws:
IOException
-
-