OutputStoragepublic class OutputStorage extends Storage Write fields to an OutputStream. |
Fields Summary |
---|
private DataOutputStream | outstream to write to |
Constructors Summary |
---|
OutputStorage(OutputStream output)Constructs an OutputStorage for an OutputStream.
out = new DataOutputStream(output);
out.writeByte(CURRENT_VERSION);
|
Methods Summary |
---|
void | writeValue(byte tag, byte[] value)Stores a byte array field as tag, BINARY_TYPE, value.
out.writeByte(tag);
out.writeByte(BINARY_TYPE);
/*
* must write our own length, because DataOutputStream does not handle
* handle byte arrays.
*/
out.writeShort(value.length);
out.write(value);
| void | writeValue(byte tag, java.lang.String value)Stores a String field as tag, STRING_TYPE, value.
out.writeByte(tag);
out.writeByte(STRING_TYPE);
out.writeUTF(value);
| void | writeValue(byte tag, long value)Stores a long field as tag, LONG_TYPE, value.
out.writeByte(tag);
out.writeByte(LONG_TYPE);
out.writeLong(value);
| void | writeValue(byte tag, boolean value)Stores a boolean field as tag, BOOLEAN_TYPE, value.
out.writeByte(tag);
out.writeByte(BOOLEAN_TYPE);
out.writeBoolean(value);
|
|