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 classSerialByteBuffer.SerialByteBufferInputStream
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_BUFFER_SCALE_FACTORstatic intDEFAULT_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 intavailable()intcapacity()voidclear()InputStreamgetInputStream()intremaining()voidwrite(byte[] data)voidwrite(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:
IOExceptionBufferOverflowException
-
write
public void write(byte[] data, int offset, int length) throws IOException- Throws:
IOException
-
-