@Override public void readFields(DataInput in) throws IOException { byte field = in.readByte(); restore(field); }
@Override public int restore(byte[] bytes, int offset, int limit) throws IOException { if (limit - offset < 1) { throw new IOException(MessageFormat.format( "Cannot restore a boolean field ({0})", "invalid length")); } restore(bytes[offset]); return 1; }