Interface OutputByteStream

All Known Implementing Classes:
NullOutputByteStream

public interface OutputByteStream
A seekable OutputStream.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Only for internal engineering use.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Only for internal engineering use.
    Only for internal engineering use.
    boolean
    eof()
    Only for internal engineering use.
    void
    Only for internal engineering use.
    long
    Only for internal engineering use.
    long
    Only for internal engineering use.
    seek(long position)
    Only for internal engineering use.
    This will return a new OutputStream that wraps the same bytes as the OutputByteStream.
    void
    write(byte[] bytes)
    Only for internal engineering use.
    void
    write(byte[] bytes, int offset, int length)
    Only for internal engineering use.
    void
    write(int b)
    Only for internal engineering use.
  • Field Details

    • EOF

      static final int EOF
      Only for internal engineering use. This api can change without notice.
      See Also:
  • Method Details

    • write

      void write(int b) throws IOException
      Only for internal engineering use. This api can change without notice. Write a byte at the current position. If the current position is at or beyond the end of the underlying data return a -1. If not beyond the end of the underlying data the current position is incremented by 1.
      Throws:
      IOException
    • write

      void write(byte[] bytes, int offset, int length) throws IOException
      Only for internal engineering use. This api can change without notice. Write an array of bytes starting at the current position. The position is incremented by the length of the array that has been written.
      Parameters:
      bytes - The source array.
      offset - The offset in the byte array to begin writing from.
      length - The number of bytes to write.
      Throws:
      IOException
    • write

      void write(byte[] bytes) throws IOException
      Only for internal engineering use. This api can change without notice. Write an array of bytes starting at the current position. The position is incremented by the length of the array that has been written.
      Parameters:
      bytes - The source array.
      Throws:
      IOException
    • seek

      OutputByteStream seek(long position) throws IOException
      Only for internal engineering use. This api can change without notice. Set the current position in the underlying data.
      Parameters:
      position - Where to set the current position.
      Returns:
      This object.
      Throws:
      IOException
    • getPosition

      long getPosition() throws IOException
      Only for internal engineering use. This api can change without notice. Get the current position.
      Returns:
      The current position.
      Throws:
      IOException
    • length

      long length() throws IOException
      Only for internal engineering use. This api can change without notice. The number of bytes that can exist in this OutputByteStream.
      Returns:
      Total number of bytes available in this OutputByteStream.
      Throws:
      IOException
    • eof

      boolean eof() throws IOException
      Only for internal engineering use. This api can change without notice. Is the current position of this OutputByteStream at or beyond the end of the underlying data.
      Returns:
      True if the current position is beyond the end of the underlying data, false otherwise.
      Throws:
      IOException
    • close

      void close() throws IOException
      Only for internal engineering use. This api can change without notice.
      Throws:
      IOException
    • closeAndConvert

      InputByteStream closeAndConvert() throws IOException
      Only for internal engineering use. This api can change without notice.
      Throws:
      IOException
    • flush

      void flush() throws IOException
      Only for internal engineering use. This api can change without notice.
      Throws:
      IOException
    • toOutputStream

      SkippingOutputStream toOutputStream() throws IOException
      This will return a new OutputStream that wraps the same bytes as the OutputByteStream. Writing to or positioning either one will affect the other. This OutputStream may be safely closed without that causing the OutputByteStream to be closed. This is commonly used for external libraries that need an OutputStream. Do NOT use it to pass data around internally as this will generally be inefficient and cause conversion and memory usage.
      Returns:
      an OutputStream that wraps the same bytes
      Throws:
      IOException