Class CircleStreamBuffer
java.lang.Object
org.apache.olingo.server.core.serializer.utils.CircleStreamBuffer
Circular stream buffer to write/read into/from one single buffer.
With support of
InputStream and OutputStream access to buffered data.-
Constructor Summary
ConstructorsConstructorDescriptionCreates aCircleStreamBufferwith default buffer size.CircleStreamBuffer(int initialCapacity) Create aCircleStreamBufferwith given initial buffer size. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes write and read part (and hence the complete buffer).voidCloses the read (output) part of theCircleStreamBuffer.voidCloses the write (input) part of theCircleStreamBuffer.GetInputStreamfor data read access.GetOutputStreamfor write data.
-
Constructor Details
-
CircleStreamBuffer
public CircleStreamBuffer()Creates aCircleStreamBufferwith default buffer size. -
CircleStreamBuffer
public CircleStreamBuffer(int initialCapacity) Create aCircleStreamBufferwith given initial buffer size.- Parameters:
initialCapacity- initial capacity of internal buffer
-
-
Method Details
-
getInputStream
GetInputStreamfor data read access.- Returns:
- the stream
-
getOutputStream
GetOutputStreamfor write data.- Returns:
- the stream
-
closeWrite
public void closeWrite()Closes the write (input) part of theCircleStreamBuffer. After this call the buffer can only be read out. -
closeRead
public void closeRead()Closes the read (output) part of theCircleStreamBuffer. After this call it is possible to write into the buffer (but can never be read out). -
close
public void close()Closes write and read part (and hence the complete buffer). -
getBuffer
- Throws:
IOException
-