@Test void testNullPadded() { StringPaddingHandler nullPadded = new NullPadded(); ByteBuffer byteBuffer = ByteBuffer.allocate(20); byteBuffer.put("hello".getBytes(US_ASCII)); byteBuffer.put(Constants.NULL); byteBuffer.put("again".getBytes(US_ASCII)); byteBuffer.put(Constants.NULL); byteBuffer.rewind(); assertThat(byteBuffer.limit(), is(20)); nullPadded.setBufferLimit(byteBuffer); assertThat(byteBuffer.limit(), is(11)); assertThat(US_ASCII.decode(byteBuffer).toString(), is("hello" + NULL_AS_CHAR + "again")); }
@Override public String toString() { return "StringData{" + "paddingType=" + paddingType + ", charset=" + charset + '}'; }
StringData extends DataType { @Override public String toString() { return "StringData{" + "paddingType=" + paddingType + ", charset=" + charset + '}'; } }
StringData extends DataType { @Override public String toString() { return "StringData{" + "paddingType=" + paddingType + ", charset=" + charset + '}'; } StringData(ByteBuffer bb); }
StringData extends DataType { @Override public String toString() { return "StringData{" + "paddingType=" + paddingType + ", charset=" + charset + '}'; } StringData(ByteBuffer bb); @Override Object fillData(ByteBuffer buffer, int[] dimensions, HdfFileChannel hdfFc); PaddingType getPaddingType(); StringPaddingHandler getStringPaddingHandler(); Charset getCharset(); @Override Class<?> getJavaType(); @Override String toString(); }
StringData extends DataType { @Override public String toString() { return "StringData{" + "paddingType=" + paddingType + ", charset=" + charset + '}'; } StringData(ByteBuffer bb); @Override Object fillData(ByteBuffer buffer, int[] dimensions, HdfFileChannel hdfFc); PaddingType getPaddingType(); StringPaddingHandler getStringPaddingHandler(); Charset getCharset(); @Override Class<?> getJavaType(); @Override String toString();  }