Class

molecule.utils

ByteBufferSegOutputStream

Related Doc: package utils

Permalink

class ByteBufferSegOutputStream extends OutputStream

Contrarily to the regular ByteArrayOutputStream this class accumulate byte buffers into a list segment and assumes a thread-safe environment and immutability which permit to optimize the code by removing synchronization and defense copying.

Linear Supertypes
OutputStream, Flushable, Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ByteBufferSegOutputStream
  2. OutputStream
  3. Flushable
  4. Closeable
  5. AutoCloseable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ByteBufferSegOutputStream()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. var baos: ByteArrayOutputStream

    Permalink
    Attributes
    protected
  6. var bcount: Int

    Permalink

    The number of valid bytes in the buffer.

    The number of valid bytes in the buffer.

    Attributes
    protected
  7. var buffer: seg.Seg[ByteBuffer]

    Permalink

    The buffer where data is stored.

    The buffer where data is stored.

    Attributes
    protected
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close(): Unit

    Permalink
    Definition Classes
    OutputStream → Closeable → AutoCloseable
    Annotations
    @throws( classOf[java.io.IOException] )
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def flush(): Unit

    Permalink
    Definition Classes
    OutputStream → Flushable
    Annotations
    @throws( classOf[java.io.IOException] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def reset(): Unit

    Permalink

    Resets the count field of this byte array output stream to zero, so that all currently accumulated output in the output stream is discarded.

    Resets the count field of this byte array output stream to zero, so that all currently accumulated output in the output stream is discarded. The output stream can be used again, reusing the already allocated buffer space.

    See also

    java.io.ByteArrayInputStream#count

  21. def result(): seg.Seg[ByteBuffer]

    Permalink

    Returns the number of byt with the list of byte arrays that have been written to this output stream.

  22. def size(): Int

    Permalink

    Returns the current size of the buffer.

    Returns the current size of the buffer.

    returns

    the value of the count field, which is the number of valid bytes in this output stream.

    See also

    java.io.ByteArrayOutputStream#count

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toByteArray(): Array[Byte]

    Permalink

    Creates a newly allocated byte array.

    Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it.

    returns

    the current contents of this output stream, as a byte array.

    See also

    java.io.ByteArrayOutputStream#size()

  25. def toString(charsetName: String): String

    Permalink

    Converts the buffer's contents into a string by decoding the bytes using the specified charsetName.

    Converts the buffer's contents into a string by decoding the bytes using the specified charsetName. The length of the new String is a function of the charset, and hence may not be equal to the length of the byte array.

    This method always replaces malformed-input and unmappable-character sequences with this charset's default replacement string. The java.nio.charset.CharsetDecoder class should be used when more control over the decoding process is required.

    charsetName

    the name of a supported charset]]

    returns

    String decoded from the buffer's contents.

    Since

    JDK1.1

    Exceptions thrown

    UnsupportedEncodingException If the named charset is not supported

  26. def toString(): String

    Permalink

    Converts the buffer's contents into a string decoding bytes using the platform's default character set.

    Converts the buffer's contents into a string decoding bytes using the platform's default character set. The length of the new String is a function of the character set, and hence may not be equal to the size of the buffer.

    This method always replaces malformed-input and unmappable-character sequences with the default replacement string for the platform's default character set. The java.nio.charset.CharsetDecoder class should be used when more control over the decoding process is required.

    returns

    String decoded from the buffer's contents.

    Definition Classes
    ByteBufferSegOutputStream → AnyRef → Any
    Since

    JDK1.1

  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def write(b: Array[Byte], off: Int, len: Int): Unit

    Permalink

    Writes len bytes from the specified byte array starting at offset off to this byte array output stream.

    Writes len bytes from the specified byte array starting at offset off to this byte array output stream.

    b

    the data.

    off

    the start offset in the data.

    len

    the number of bytes to write.

    Definition Classes
    ByteBufferSegOutputStream → OutputStream
  31. def write(b: ByteBuffer): Unit

    Permalink
  32. def write(b: Array[Byte]): Unit

    Permalink
    Definition Classes
    ByteBufferSegOutputStream → OutputStream
  33. def write(b: Int): Unit

    Permalink

    Writes the specified byte to this byte array output stream.

    Writes the specified byte to this byte array output stream.

    b

    the byte to be written.

    Definition Classes
    ByteBufferSegOutputStream → OutputStream
  34. def writeTo(out: OutputStream): Unit

    Permalink

    Writes the complete contents of this byte array output stream to the specified output stream argument, as if by calling the output stream's write method using out.write(buf, 0, count).

    Writes the complete contents of this byte array output stream to the specified output stream argument, as if by calling the output stream's write method using out.write(buf, 0, count).

    out

    the output stream to which to write the data.

    Exceptions thrown

    IOException if an I/O error occurs.

Inherited from OutputStream

Inherited from Flushable

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped