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 of InputStream and OutputStream access to buffered data.
  • Constructor Details

    • CircleStreamBuffer

      public CircleStreamBuffer()
      Creates a CircleStreamBuffer with default buffer size.
    • CircleStreamBuffer

      public CircleStreamBuffer(int initialCapacity)
      Create a CircleStreamBuffer with given initial buffer size.
      Parameters:
      initialCapacity - initial capacity of internal buffer
  • Method Details

    • getInputStream

      public InputStream getInputStream()
      Get InputStream for data read access.
      Returns:
      the stream
    • getOutputStream

      public OutputStream getOutputStream()
      Get OutputStream for write data.
      Returns:
      the stream
    • closeWrite

      public void closeWrite()
      Closes the write (input) part of the CircleStreamBuffer. After this call the buffer can only be read out.
    • closeRead

      public void closeRead()
      Closes the read (output) part of the CircleStreamBuffer. 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).