- @Override
- public void unmarshal(Data data, DataInputStream is) throws IOException {
- /*int version = */readHeader(is,MAGIC,VERSION);
- // If Version Changes between Production runs, you'll need to do a switch Statement, and adequately read in fields
- byte[] buff = new byte[BUFF_SIZE];
- data.id = readString(is,buff);
- data.type = is.readInt();
-
- long l = is.readLong();
- data.expires = l<0?null:new Date(l);
- data.other = is.readInt();
- data.ns = readString(is,buff);
- data.notes = readString(is,buff);
-
- int i = is.readInt();
- data.cred=null;
- if(i>=0) {
- byte[] bytes = new byte[i]; // a bit dangerous, but lessened because of all the previous sized data reads
- int read = is.read(bytes);
- if(read>0) {
- data.cred = ByteBuffer.wrap(bytes);
- }
- }
- }
+ @Override
+ public void unmarshal(Data data, DataInputStream is) throws IOException {
+ /*int version = */readHeader(is,MAGIC,VERSION);
+ // If Version Changes between Production runs, you'll need to do a switch Statement, and adequately read in fields
+ byte[] buff = new byte[BUFF_SIZE];
+ data.id = readString(is,buff);
+ data.type = is.readInt();
+
+ long l = is.readLong();
+ data.expires = l<0?null:new Date(l);
+ data.other = is.readInt();
+ data.ns = readString(is,buff);
+ data.notes = readString(is,buff);
+
+ int i = is.readInt();
+ data.cred=null;
+ if(i>=0) {
+ byte[] bytes = new byte[i]; // a bit dangerous, but lessened because of all the previous sized data reads
+ int read = is.read(bytes);
+ if(read>0) {
+ data.cred = ByteBuffer.wrap(bytes);
+ }
+ }
+ }