Interface OutputByteStream

  • All Known Implementing Classes:
    NullOutputByteStream

    public interface OutputByteStream
    A seekable OutputStream.
    • Field Summary

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Only for internal engineering use.
      InputByteStream closeAndConvert()
      Only for internal engineering use.
      boolean eof()
      Only for internal engineering use.
      void flush()
      Only for internal engineering use.
      long getPosition()
      Only for internal engineering use.
      long length()
      Only for internal engineering use.
      OutputByteStream seek​(long position)
      Only for internal engineering use.
      SkippingOutputStream toOutputStream()
      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 Detail

      • EOF

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

      • write

        void write​(int b)
            throws java.io.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:
        java.io.IOException
      • write

        void write​(byte[] bytes,
                   int offset,
                   int length)
            throws java.io.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:
        java.io.IOException
      • write

        void write​(byte[] bytes)
            throws java.io.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:
        java.io.IOException
      • seek

        OutputByteStream seek​(long position)
                       throws java.io.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:
        java.io.IOException
      • getPosition

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

        long length()
             throws java.io.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:
        java.io.IOException
      • eof

        boolean eof()
             throws java.io.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:
        java.io.IOException
      • close

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

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

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

        SkippingOutputStream toOutputStream()
                                     throws java.io.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:
        java.io.IOException