Package com.yahoo.io

Class ByteWriter

  • All Implemented Interfaces:
    WritableByteTransmitter, java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class ByteWriter
    extends AbstractByteWriter
    A buffered writer which accepts byte arrays in addition to character arrays.
    Author:
    Steinar Knutsen
    • Constructor Detail

      • ByteWriter

        public ByteWriter​(java.io.OutputStream stream,
                          java.nio.charset.CharsetEncoder encoder)
      • ByteWriter

        public ByteWriter​(java.io.OutputStream stream)
    • Method Detail

      • send

        public void send​(java.nio.ByteBuffer b)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Writer
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Specified by:
        flush in class java.io.Writer
        Throws:
        java.io.IOException