molecule.utils

ByteArrayListOutputStream

class ByteArrayListOutputStream extends OutputStream

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

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

Instance Constructors

  1. new ByteArrayListOutputStream()

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. var baos: ByteArrayOutputStream

    Attributes
    protected
  8. val buf: ListBuffer[Array[Byte]]

    The buffer where data is stored.

    The buffer where data is stored.

    Attributes
    protected
  9. def clone(): AnyRef

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

    Definition Classes
    OutputStream → Closeable → AutoCloseable
    Annotations
    @throws()
  11. var count: Int

    The number of valid bytes in the buffer.

    The number of valid bytes in the buffer.

    Attributes
    protected
  12. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def flush(): Unit

    Definition Classes
    OutputStream → Flushable
    Annotations
    @throws()
  16. final def getClass(): java.lang.Class[_]

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

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

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

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def reset(): Unit

    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

  23. def result(): (Int, List[Array[Byte]])

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

  24. def size(): Int

    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

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

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

    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()

  27. def toString(charsetName: String): String

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

    Converts the buffer's contents into a string by decoding the bytes using the specified java.nio.charset.Charset 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 plain java.nio.charset.Charset charset`

    returns

    String decoded from the buffer's contents.

    Since

    JDK1.1

    Exceptions thrown
    UnsupportedEncodingException

    If the named charset is not supported

  28. def toString(): String

    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 plain 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
    ByteArrayListOutputStream → AnyRef → Any
    Since

    JDK1.1

  29. final def wait(): Unit

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

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

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

    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
    ByteArrayListOutputStream → OutputStream
  33. def write(b: Array[Byte]): Unit

    Definition Classes
    ByteArrayListOutputStream → OutputStream
  34. def write(b: Int): Unit

    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
    ByteArrayListOutputStream → OutputStream
  35. def writeTo(out: OutputStream): Unit

    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