Interface PrimitiveSink

    • Method Detail

      • putByte

        PrimitiveSink putByte(byte b)
        Puts a byte into this sink.
        Parameters:
        b - a byte
        Returns:
        this instance
      • putBytes

        PrimitiveSink putBytes(byte[] bytes)
        Puts an array of bytes into this sink.
        Parameters:
        bytes - a byte array
        Returns:
        this instance
      • putBytes

        PrimitiveSink putBytes(byte[] bytes,
                               int off,
                               int len)
        Puts a chunk of an array of bytes into this sink. bytes[off] is the first byte written, bytes[off + len - 1] is the last.
        Parameters:
        bytes - a byte array
        off - the start offset in the array
        len - the number of bytes to write
        Returns:
        this instance
        Throws:
        IndexOutOfBoundsException - if off < 0 or off + len > bytes.length or len < 0
      • putBytes

        PrimitiveSink putBytes(ByteBuffer bytes)
        Puts the remaining bytes of a byte buffer into this sink. bytes.position() is the first byte written, bytes.limit() - 1 is the last. The position of the buffer will be equal to the limit when this method returns.
        Parameters:
        bytes - a byte buffer
        Returns:
        this instance
        Since:
        23.0
      • putString

        PrimitiveSink putString(CharSequence charSequence,
                                Charset charset)
        Puts a string into this sink using the given charset.

        Warning: This method, which reencodes the input before processing it, is useful only for cross-language compatibility. For other use cases, prefer putUnencodedChars(java.lang.CharSequence), which is faster, produces the same output across Java releases, and processes every char in the input, even if some are invalid.