/** * Append a single byte to the buffer. * @return {@code this} to allow call chaining */ public final Buffer append( byte b ) { makeroom( 0, 1 ); bytes[ offset + length++ ] = b; return this; }
/** * Append a single byte to the buffer. * @return {@code this} to allow call chaining */ public final Buffer append( byte b ) { makeroom( 0, 1 ); bytes[ offset + length++ ] = b; return this; }
/** * Append a single byte to the buffer. * @return {@code this} to allow call chaining */ public final Buffer append( byte b ) { makeroom( 0, 1 ); bytes[ offset + length++ ] = b; return this; }
/** Concatenate bytes from a {@link LuaString} onto the front of this buffer * @param s the left-hand-side value which we will concatenate onto the front of {@code this} * @return {@link Buffer} for use in call chaining. */ public Buffer prepend(LuaString s) { int n = s.m_length; makeroom( n, 0 ); System.arraycopy( s.m_bytes, s.m_offset, bytes, offset-n, n ); offset -= n; length += n; value = null; return this; }
/** Concatenate bytes from a {@link LuaString} onto the front of this buffer * @param s the left-hand-side value which we will concatenate onto the front of {@code this} * @return {@link Buffer} for use in call chaining. */ public Buffer prepend(LuaString s) { int n = s.m_length; makeroom( n, 0 ); System.arraycopy( s.m_bytes, s.m_offset, bytes, offset-n, n ); offset -= n; length += n; value = null; return this; }
/** Concatenate bytes from a {@link LuaString} onto the front of this buffer * @param s the left-hand-side value which we will concatenate onto the front of {@code this} * @return {@link Buffer} for use in call chaining. */ public Buffer prepend(LuaString s) { int n = s.m_length; makeroom( n, 0 ); System.arraycopy( s.m_bytes, s.m_offset, bytes, offset-n, n ); offset -= n; length += n; value = null; return this; }
/** * Append a {@link LuaString} to the buffer. * @return {@code this} to allow call chaining */ public final Buffer append( LuaString str ) { final int n = str.m_length; makeroom( 0, n ); str.copyInto( 0, bytes, offset + length, n ); length += n; return this; }
/** * Append a {@link LuaString} to the buffer. * @return {@code this} to allow call chaining */ public final Buffer append( LuaString str ) { final int n = str.m_length; makeroom( 0, n ); str.copyInto( 0, bytes, offset + length, n ); length += n; return this; }
/** * Append a {@link LuaString} to the buffer. * @return {@code this} to allow call chaining */ public final Buffer append( LuaString str ) { final int n = str.m_length; makeroom( 0, n ); str.copyInto( 0, bytes, offset + length, n ); length += n; return this; }
/** * Append a Java String to the buffer. * The Java string will be converted to bytes using the UTF8 encoding. * @return {@code this} to allow call chaining * @see LuaString#encodeToUtf8(char[], int, byte[], int) */ public final Buffer append( String str ) { char[] c = str.toCharArray(); final int n = LuaString.lengthAsUtf8( c ); makeroom( 0, n ); LuaString.encodeToUtf8( c, c.length, bytes, offset + length ); length += n; return this; }
/** * Append a Java String to the buffer. * The Java string will be converted to bytes using the UTF8 encoding. * @return {@code this} to allow call chaining * @see LuaString#encodeToUtf8(char[], int, byte[], int) */ public final Buffer append( String str ) { char[] c = str.toCharArray(); final int n = LuaString.lengthAsUtf8( c ); makeroom( 0, n ); LuaString.encodeToUtf8( c, c.length, bytes, offset + length ); length += n; return this; }
/** * Append a Java String to the buffer. * The Java string will be converted to bytes using the UTF8 encoding. * @return {@code this} to allow call chaining * @see LuaString#encodeToUtf8(char[], int, byte[], int) */ public final Buffer append( String str ) { char[] c = str.toCharArray(); final int n = LuaString.lengthAsUtf8( c ); makeroom( 0, n ); LuaString.encodeToUtf8( c, c.length, bytes, offset + length ); length += n; return this; }