PdxField implements DataSerializable, Comparable<PdxField> { public void toStream(PrintStream printStream) { printStream.print(" "); printStream.print(getFieldType()); printStream.print(' '); printStream.print(this.getFieldName()); printStream.print(';'); if (isIdentityField()) { printStream.print(" } if (isDeleted()) { printStream.print(" } printStream.println(); } PdxField();  PdxField(String fieldName, int index, int varId, FieldType type, boolean identityField); protected  PdxField(PdxField other); String getFieldName(); int getFieldIndex(); int getVarLenFieldSeqId(); boolean isVariableLengthType(); FieldType getFieldType(); int getRelativeOffset(); void setRelativeOffset(int relativeOffset); int getVlfOffsetIndex(); void setVlfOffsetIndex(int vlfOffsetIndex); void setIdentityField(boolean identityField); boolean isIdentityField(); void setDeleted(boolean v); boolean isDeleted(); @Override void fromData(DataInput in); @Override void toData(DataOutput out); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString(); String getTypeIdString(); @Override int compareTo(PdxField o); void toStream(PrintStream printStream);  }
@Test public void testToStream() { final PdxField field = new PdxField(FIELD_NAME, FIELD_INDEX, VAR_LEN_FIELD_SEQ_ID, FIELD_TYPE, IDENTITY_FIELD); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); field.toStream(new PrintStream(byteArrayOutputStream)); assertNotEquals(-1, byteArrayOutputStream.toString().indexOf(FIELD_NAME)); }