Class CircleStreamBuffer
- java.lang.Object
-
- org.apache.olingo.odata2.core.ep.util.CircleStreamBuffer
-
public class CircleStreamBuffer extends Object
Circular stream buffer to write/read into/from one single buffer. With support ofInputStreamandOutputStreamaccess to buffered data.
-
-
Constructor Summary
Constructors Constructor Description CircleStreamBuffer()Creates aCircleStreamBufferwith default buffer size.CircleStreamBuffer(int initialCapacity)Create aCircleStreamBufferwith given initial buffer size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes write and read part (and hence the complete buffer).voidcloseRead()Closes the read (output) part of theCircleStreamBuffer.voidcloseWrite()Closes the write (input) part of theCircleStreamBuffer.InputStreamgetInputStream()GetInputStreamfor data read access.OutputStreamgetOutputStream()GetOutputStreamfor write data.
-
-
-
Constructor Detail
-
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 Detail
-
getInputStream
public InputStream getInputStream()
GetInputStreamfor data read access.- Returns:
- the stream
-
getOutputStream
public OutputStream 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).
-
-