GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.buffer
  • ByteBufOutputStream

This view

  • Original page
  • New address

GeezerVison is showing netty.io — ByteBufOutputStream (Netty API Reference (4.1.141.Final))

Class ByteBufOutputStream

java.lang.Object
java.io.OutputStream
io.netty.buffer.ByteBufOutputStream
All Implemented Interfaces:
Closeable, DataOutput, Flushable, AutoCloseable

public class ByteBufOutputStream extends OutputStream implements DataOutput
An OutputStream which writes data to a ByteBuf.

A write operation against this stream will occur at the writerIndex of its underlying buffer and the writerIndex will increase during the write operation.

This stream implements DataOutput for your convenience. The endianness of the stream is not always big endian but depends on the endianness of the underlying buffer.

See Also:
  • ByteBufInputStream
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteBufOutputStream(ByteBuf buffer)
    Creates a new stream which writes data to the specified buffer.
    ByteBufOutputStream(ByteBuf buffer, boolean releaseOnClose)
    Creates a new stream which writes data to the specified buffer.
  • Method Summary

    Modifier and Type
    Method
    Description
    ByteBuf
    buffer()
    Returns the buffer where this stream is writing data.
    void
    close()
     
    void
    write(byte[] b)
     
    void
    write(byte[] b, int off, int len)
     
    void
    write(int b)
     
    void
    writeBoolean(boolean v)
     
    void
    writeByte(int v)
     
    void
    writeBytes(String s)
     
    void
    writeChar(int v)
     
    void
    writeChars(String s)
     
    void
    writeDouble(double v)
     
    void
    writeFloat(float v)
     
    void
    writeInt(int v)
     
    void
    writeLong(long v)
     
    void
    writeShort(int v)
     
    void
    writeUTF(String s)
     
    int
    writtenBytes()
    Returns the number of written bytes by this stream so far.

    Methods inherited from class OutputStream

    flush

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteBufOutputStream

      public ByteBufOutputStream(ByteBuf buffer)
      Creates a new stream which writes data to the specified buffer.
    • ByteBufOutputStream

      public ByteBufOutputStream(ByteBuf buffer, boolean releaseOnClose)
      Creates a new stream which writes data to the specified buffer.
      Parameters:
      buffer - Writes data to the buffer for this OutputStream.
      releaseOnClose - true means that when close() is called then ReferenceCounted.release() will be called on buffer.
  • Method Details

    • writtenBytes

      public int writtenBytes()
      Returns the number of written bytes by this stream so far.
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Specified by:
      write in interface DataOutput
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b) throws IOException
      Specified by:
      write in interface DataOutput
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(int b) throws IOException
      Specified by:
      write in interface DataOutput
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • writeBoolean

      public void writeBoolean(boolean v) throws IOException
      Specified by:
      writeBoolean in interface DataOutput
      Throws:
      IOException
    • writeByte

      public void writeByte(int v) throws IOException
      Specified by:
      writeByte in interface DataOutput
      Throws:
      IOException
    • writeBytes

      public void writeBytes(String s) throws IOException
      Specified by:
      writeBytes in interface DataOutput
      Throws:
      IOException
    • writeChar

      public void writeChar(int v) throws IOException
      Specified by:
      writeChar in interface DataOutput
      Throws:
      IOException
    • writeChars

      public void writeChars(String s) throws IOException
      Specified by:
      writeChars in interface DataOutput
      Throws:
      IOException
    • writeDouble

      public void writeDouble(double v) throws IOException
      Specified by:
      writeDouble in interface DataOutput
      Throws:
      IOException
    • writeFloat

      public void writeFloat(float v) throws IOException
      Specified by:
      writeFloat in interface DataOutput
      Throws:
      IOException
    • writeInt

      public void writeInt(int v) throws IOException
      Specified by:
      writeInt in interface DataOutput
      Throws:
      IOException
    • writeLong

      public void writeLong(long v) throws IOException
      Specified by:
      writeLong in interface DataOutput
      Throws:
      IOException
    • writeShort

      public void writeShort(int v) throws IOException
      Specified by:
      writeShort in interface DataOutput
      Throws:
      IOException
    • writeUTF

      public void writeUTF(String s) throws IOException
      Specified by:
      writeUTF in interface DataOutput
      Throws:
      IOException
    • buffer

      public ByteBuf buffer()
      Returns the buffer where this stream is writing data.
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.