io.vertx.rxjava.core.buffer

## Class Buffer

- java.lang.Object
- - io.vertx.rxjava.core.buffer.Buffer

-     public class Buffer
      extends Object

  Most data is shuffled around inside Vert.x using buffers.

  A buffer is a sequence of zero or more bytes that can read from or written to and which expands automatically as necessary to accommodate any bytes written to it. You can perhaps think of a buffer as smart byte array.

  Please consult the documentation for more information on buffers.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Buffer(Buffer delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Buffer` | `appendBuffer(Buffer buff)` Appends the specified `Buffer` to the end of this Buffer.
    `Buffer` | `appendBuffer(Buffer buff, int offset, int len)` Appends the specified `Buffer` starting at the `offset` using `len` to the end of this Buffer.
    `Buffer` | `appendByte(byte b)` Appends the specified `byte` to the end of the Buffer.
    `Buffer` | `appendDouble(double d)` Appends the specified `double` to the end of the Buffer.
    `Buffer` | `appendFloat(float f)` Appends the specified `float` to the end of the Buffer.
    `Buffer` | `appendInt(int i)` Appends the specified `int` to the end of the Buffer.
    `Buffer` | `appendLong(long l)` Appends the specified `long` to the end of the Buffer.
    `Buffer` | `appendShort(short s)` Appends the specified `short` to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.
    `Buffer` | `appendString(String str)` Appends the specified `String str` to the end of the Buffer with UTF-8 encoding.
    `Buffer` | `appendString(String str, String enc)` Appends the specified `String` to the end of the Buffer with the encoding as specified by `enc`.
    `static Buffer` | `buffer()` Create a new, empty buffer.
    `static Buffer` | `buffer(int initialSizeHint)` Create a new buffer given the initial size hint.
    `static Buffer` | `buffer(String string)` Create a new buffer from a string.
    `static Buffer` | `buffer(String string, String enc)` Create a new buffer from a string and using the specified encoding.
    `Buffer` | `copy()` Returns a copy of the entire Buffer.
    `Buffer` | `getBuffer(int start, int end)` Returns a copy of a sub-sequence the Buffer as a `Buffer` starting at position `start` and ending at position `end - 1`
    `byte` | `getByte(int pos)` Returns the `byte` at position `pos` in the Buffer.
    `Object` | `getDelegate()`
    `double` | `getDouble(int pos)` Returns the `double` at position `pos` in the Buffer.
    `float` | `getFloat(int pos)` Returns the `float` at position `pos` in the Buffer.
    `int` | `getInt(int pos)` Returns the `int` at position `pos` in the Buffer.
    `long` | `getLong(int pos)` Returns the `long` at position `pos` in the Buffer.
    `short` | `getShort(int pos)` Returns the `short` at position `pos` in the Buffer.
    `String` | `getString(int start, int end)` Returns a copy of a sub-sequence the Buffer as a `String` starting at position `start` and ending at position `end - 1` interpreted as a String in UTF-8 encoding
    `String` | `getString(int start, int end, String enc)` Returns a copy of a sub-sequence the Buffer as a `String` starting at position `start` and ending at position `end - 1` interpreted as a String in the specified encoding
    `int` | `length()` Returns the length of the buffer, measured in bytes.
    `static Buffer` | `newInstance(Buffer arg)`
    `Buffer` | `setBuffer(int pos, Buffer b)` Sets the bytes at position `pos` in the Buffer to the bytes represented by the `Buffer b`.
    `Buffer` | `setBuffer(int pos, Buffer b, int offset, int len)` Sets the bytes at position `pos` in the Buffer to the bytes represented by the `Buffer b` on the given `offset` and `len`.
    `Buffer` | `setByte(int pos, byte b)` Sets the `byte` at position `pos` in the Buffer to the value `b`.
    `Buffer` | `setDouble(int pos, double d)` Sets the `double` at position `pos` in the Buffer to the value `d`.
    `Buffer` | `setFloat(int pos, float f)` Sets the `float` at position `pos` in the Buffer to the value `f`.
    `Buffer` | `setInt(int pos, int i)` Sets the `int` at position `pos` in the Buffer to the value `i`.
    `Buffer` | `setLong(int pos, long l)` Sets the `long` at position `pos` in the Buffer to the value `l`.
    `Buffer` | `setShort(int pos, short s)` Sets the `short` at position `pos` in the Buffer to the value `s`.
    `Buffer` | `setString(int pos, String str)` Sets the bytes at position `pos` in the Buffer to the value of `str` encoded in UTF-8.
    `Buffer` | `setString(int pos, String str, String enc)` Sets the bytes at position `pos` in the Buffer to the value of `str` encoded in encoding `enc`.
    `Buffer` | `slice()` Returns a slice of this buffer.
    `Buffer` | `slice(int start, int end)` Returns a slice of this buffer.
    `String` | `toString(String enc)` Returns a `String` representation of the Buffer with the encoding specified by `enc`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Buffer

          public Buffer(Buffer delegate)

  - ### Method Detail

    - #### getDelegate

          public Object getDelegate()

    - #### buffer

          public static Buffer buffer()

      Create a new, empty buffer.
      Returns:
        the buffer

    - #### buffer

          public static Buffer buffer(int initialSizeHint)

      Create a new buffer given the initial size hint.

      If you know the buffer will require a certain size, providing the hint can prevent unnecessary re-allocations as the buffer is written to and resized.

      Parameters:
        `initialSizeHint` - the hint, in bytes
      Returns:
        the buffer

    - #### buffer

          public static Buffer buffer(String string)

      Create a new buffer from a string. The string will be UTF-8 encoded into the buffer.
      Parameters:
        `string` - the string
      Returns:
        the buffer

    - #### buffer

          public static Buffer buffer(String string,
                                      String enc)

      Create a new buffer from a string and using the specified encoding. The string will be encoded into the buffer using the specified encoding.
      Parameters:
        `string` - the string
        `enc` -
      Returns:
        the buffer

    - #### toString

          public String toString(String enc)

      Returns a `String` representation of the Buffer with the encoding specified by `enc`
      Parameters:
        `enc` -
      Returns:

    - #### getByte

          public byte getByte(int pos)

      Returns the `byte` at position `pos` in the Buffer.
      Parameters:
        `pos` -
      Returns:

    - #### getInt

          public int getInt(int pos)

      Returns the `int` at position `pos` in the Buffer.
      Parameters:
        `pos` -
      Returns:

    - #### getLong

          public long getLong(int pos)

      Returns the `long` at position `pos` in the Buffer.
      Parameters:
        `pos` -
      Returns:

    - #### getDouble

          public double getDouble(int pos)

      Returns the `double` at position `pos` in the Buffer.
      Parameters:
        `pos` -
      Returns:

    - #### getFloat

          public float getFloat(int pos)

      Returns the `float` at position `pos` in the Buffer.
      Parameters:
        `pos` -
      Returns:

    - #### getShort

          public short getShort(int pos)

      Returns the `short` at position `pos` in the Buffer.
      Parameters:
        `pos` -
      Returns:

    - #### getBuffer

          public Buffer getBuffer(int start,
                                  int end)

      Returns a copy of a sub-sequence the Buffer as a `Buffer` starting at position `start` and ending at position `end - 1`
      Parameters:
        `start` -
        `end` -
      Returns:

    - #### getString

          public String getString(int start,
                                  int end,
                                  String enc)

      Returns a copy of a sub-sequence the Buffer as a `String` starting at position `start` and ending at position `end - 1` interpreted as a String in the specified encoding
      Parameters:
        `start` -
        `end` -
        `enc` -
      Returns:

    - #### getString

          public String getString(int start,
                                  int end)

      Returns a copy of a sub-sequence the Buffer as a `String` starting at position `start` and ending at position `end - 1` interpreted as a String in UTF-8 encoding
      Parameters:
        `start` -
        `end` -
      Returns:

    - #### appendBuffer

          public Buffer appendBuffer(Buffer buff)

      Appends the specified `Buffer` to the end of this Buffer. The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `buff` -
      Returns:

    - #### appendBuffer

          public Buffer appendBuffer(Buffer buff,
                                     int offset,
                                     int len)

      Appends the specified `Buffer` starting at the `offset` using `len` to the end of this Buffer. The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `buff` -
        `offset` -
        `len` -
      Returns:

    - #### appendByte

          public Buffer appendByte(byte b)

      Appends the specified `byte` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `b` -
      Returns:

    - #### appendInt

          public Buffer appendInt(int i)

      Appends the specified `int` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `i` -
      Returns:

    - #### appendLong

          public Buffer appendLong(long l)

      Appends the specified `long` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `l` -
      Returns:

    - #### appendShort

          public Buffer appendShort(short s)

      Appends the specified `short` to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `s` -
      Returns:

    - #### appendFloat

          public Buffer appendFloat(float f)

      Appends the specified `float` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `f` -
      Returns:

    - #### appendDouble

          public Buffer appendDouble(double d)

      Appends the specified `double` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `d` -
      Returns:

    - #### appendString

          public Buffer appendString(String str,
                                     String enc)

      Appends the specified `String` to the end of the Buffer with the encoding as specified by `enc`.

      The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together.

      Parameters:
        `str` -
        `enc` -
      Returns:

    - #### appendString

          public Buffer appendString(String str)

      Appends the specified `String str` to the end of the Buffer with UTF-8 encoding.

      The buffer will expand as necessary to accommodate any bytes written.

      Returns a reference to `this` so multiple operations can be appended together

      Parameters:
        `str` -
      Returns:

    - #### setByte

          public Buffer setByte(int pos,
                                byte b)

      Sets the `byte` at position `pos` in the Buffer to the value `b`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `b` -
      Returns:

    - #### setInt

          public Buffer setInt(int pos,
                               int i)

      Sets the `int` at position `pos` in the Buffer to the value `i`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `i` -
      Returns:

    - #### setLong

          public Buffer setLong(int pos,
                                long l)

      Sets the `long` at position `pos` in the Buffer to the value `l`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `l` -
      Returns:

    - #### setDouble

          public Buffer setDouble(int pos,
                                  double d)

      Sets the `double` at position `pos` in the Buffer to the value `d`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `d` -
      Returns:

    - #### setFloat

          public Buffer setFloat(int pos,
                                 float f)

      Sets the `float` at position `pos` in the Buffer to the value `f`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `f` -
      Returns:

    - #### setShort

          public Buffer setShort(int pos,
                                 short s)

      Sets the `short` at position `pos` in the Buffer to the value `s`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `s` -
      Returns:

    - #### setBuffer

          public Buffer setBuffer(int pos,
                                  Buffer b)

      Sets the bytes at position `pos` in the Buffer to the bytes represented by the `Buffer b`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `b` -
      Returns:

    - #### setBuffer

          public Buffer setBuffer(int pos,
                                  Buffer b,
                                  int offset,
                                  int len)

      Sets the bytes at position `pos` in the Buffer to the bytes represented by the `Buffer b` on the given `offset` and `len`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `b` -
        `offset` -
        `len` -
      Returns:

    - #### setString

          public Buffer setString(int pos,
                                  String str)

      Sets the bytes at position `pos` in the Buffer to the value of `str` encoded in UTF-8.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `str` -
      Returns:

    - #### setString

          public Buffer setString(int pos,
                                  String str,
                                  String enc)

      Sets the bytes at position `pos` in the Buffer to the value of `str` encoded in encoding `enc`.

      The buffer will expand as necessary to accommodate any value written.

      Parameters:
        `pos` -
        `str` -
        `enc` -
      Returns:

    - #### length

          public int length()

      Returns the length of the buffer, measured in bytes. All positions are indexed from zero.
      Returns:

    - #### copy

          public Buffer copy()

      Returns a copy of the entire Buffer.
      Returns:

    - #### slice

          public Buffer slice()

      Returns a slice of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks.
      Returns:

    - #### slice

          public Buffer slice(int start,
                              int end)

      Returns a slice of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks.
      Parameters:
        `start` -
        `end` -
      Returns:

    - #### newInstance

          public static Buffer newInstance(Buffer arg)

Copyright © 2015. All Rights Reserved.