WriteBuffer { public void writeAscii(String v) { for (int i = 0, length = v.length(); i < length; i++) { writeByte(v.charAt(i) & 0xff); } } WriteBuffer(byte[] buf, int pos); static WriteBuffer wrap(byte[] bytes); static WriteBuffer wrap(byte[] bytes, int pos); void writeByte(int v); void write(byte[] v); void writeAscii(String v); void writeUtf8(CharSequence string); void writeUtf8(CharSequence string, int fromIndex, int toIndex); void writeAscii(long v); @Override String toString(); static int utf8SizeInBytes(CharSequence string); static int asciiSizeInBytes(long v);  }
@Test public void writeAscii_long() { assertThat(writeAscii(-1005656679588439279L)) .isEqualTo("-1005656679588439279"); assertThat(writeAscii(0L)) .isEqualTo("0"); assertThat(writeAscii(-9223372036854775808L )) .isEqualTo("-9223372036854775808"); assertThat(writeAscii(123456789L)) .isEqualTo("123456789"); }