StringRecord implements Record { public StringRecord() { this.bytes = EMPTY_BYTES; this.hash = 0; } StringRecord();  StringRecord(final String string);  StringRecord(final StringRecord utf8);  StringRecord(final byte[] utf8); byte[] getBytes(); int charAt(final int position); int find(final String what); int find(final String what, final int start); void set(final String string); void set(final byte[] utf8); void set(final StringRecord other); int getLength(); void set(final byte[] utf8, final int start, final int len); void append(final byte[] utf8, final int start, final int len); void clear(); String toString(); void read(final DataInput in); static void skip(final DataInput in); static void skipFully(final DataInput in, final int len); void write(final DataOutput out); @Override boolean equals(final Object obj); @Override int hashCode(); static String decode(final byte[] utf8); static String decode(final byte[] utf8, final int start, final int length); static String decode(final byte[] utf8, final int start, final int length, final boolean replace); static ByteBuffer encode(final String string); static ByteBuffer encode(final String string, final boolean replace); static String readString(final DataInput in); static int writeString(final DataOutput out, final String s); static void validateUTF8(final byte[] utf8); static void validateUTF8(final byte[] utf8, final int start, final int len); static int bytesToCodePoint(final ByteBuffer bytes); static int utf8Length(final String string);  }
@Test public void testStringRecord() { final StringRecord orig = new StringRecord("Test Record"); try { final StringRecord copy = (StringRecord) CommonTestUtils.createCopy(orig); assertEquals(orig.getLength(), copy.getLength()); assertEquals(orig.toString(), copy.toString()); assertEquals(orig, copy); assertEquals(orig.hashCode(), copy.hashCode()); } catch (IOException ioe) { fail(ioe.getMessage()); } }