Class ByteArrayStreamingContent

  • All Implemented Interfaces:
    StreamingContent

    @Deprecated
    public class ByteArrayStreamingContent
    extends java.lang.Object
    implements StreamingContent
    Deprecated.
    use com.google.common.io.ByteSource
    Streaming content whose source is a byte array.

    Implementation is not thread-safe.

    Since:
    1.14
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] byteArray
      Deprecated.
      Byte array content.
      private int length
      Deprecated.
      Length of bytes to read from byte array.
      private int offset
      Deprecated.
      Starting offset into the byte array.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void writeTo​(java.io.OutputStream out)
      Deprecated.
      Writes the byte content to the given output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • byteArray

        private final byte[] byteArray
        Deprecated.
        Byte array content.
      • offset

        private final int offset
        Deprecated.
        Starting offset into the byte array.
      • length

        private final int length
        Deprecated.
        Length of bytes to read from byte array.
    • Constructor Detail

      • ByteArrayStreamingContent

        public ByteArrayStreamingContent​(byte[] byteArray)
        Deprecated.
        Parameters:
        byteArray - byte array content
      • ByteArrayStreamingContent

        public ByteArrayStreamingContent​(byte[] byteArray,
                                         int offset,
                                         int length)
        Deprecated.
        Parameters:
        byteArray - byte array content
        offset - starting offset into the byte array
        length - of bytes to read from byte array
    • Method Detail

      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Deprecated.
        Description copied from interface: StreamingContent
        Writes the byte content to the given output stream.

        Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the output stream has not been closed, and will fail to work if it has been closed.

        Specified by:
        writeTo in interface StreamingContent
        Parameters:
        out - output stream
        Throws:
        java.io.IOException