Class ByteOutputStream

    • Field Detail

      • buf

        protected byte[] buf
        The buffer where data is stored.
      • count

        protected int count
        The number of valid bytes in the buffer.
    • Constructor Detail

      • ByteOutputStream

        public ByteOutputStream()
      • ByteOutputStream

        public ByteOutputStream​(int size)
    • Method Detail

      • write

        public void write​(InputStream in)
                   throws IOException
        Copies all the bytes from this input into this buffer.
        Parameters:
        in - input stream.
        Throws:
        IOException - in case of an I/O error.
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Overrides:
        write in class OutputStream
      • writeAsAscii

        public void writeAsAscii​(String s)
        Writes a string as ASCII string.
        Parameters:
        s - string to write.
      • reset

        public void reset()
      • toByteArray

        @Deprecated
        public byte[] toByteArray()
        Deprecated.
        because this is evil!
        Evil buffer reallocation method. Don't use it unless you absolutely have to.
        Returns:
        byte array
      • size

        public int size()
      • toString

        public String toString()
        Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding.
        Overrides:
        toString in class Object
        Returns:
        String translated from the buffer's contents.
        Since:
        JDK1.1
      • getBytes

        public byte[] getBytes()
      • getCount

        public int getCount()