Example #1
0
 public void writeObject(Object o) throws MessageFormatException {
   StreamItem item = new StreamItem();
   if (o instanceof Boolean) {
     item.booleanValue((Boolean) o);
   } else if (o instanceof Byte) {
     item.byteValue((Byte) o);
   } else if (o instanceof Short) {
     item.shortValue((Short) o);
   } else if (o instanceof Character) {
     item.charValue((Character) o);
   } else if (o instanceof Integer) {
     item.intValue((Integer) o);
   } else if (o instanceof Long) {
     item.longValue((Long) o);
   } else if (o instanceof Float) {
     item.floatValue((Float) o);
   } else if (o instanceof Double) {
     item.doubleValue((Double) o);
   } else if (o instanceof String) {
     item.stringValue((String) o);
   } else if (o instanceof byte[]) {
     item.byteArrayValue((byte[]) o);
   } else {
     throw new MessageFormatException("Invalid value type passed in for writeObject()");
   }
   items.add(item);
 }
Example #2
0
 public void writeBytes(byte[] bytes) {
   StreamItem item = new StreamItem();
   byte[] subBytes = ByteArrays.extractSubBytes(bytes, 0, bytes.length);
   item.byteArrayValue(subBytes);
   items.add(item);
 }
Example #3
0
 public void writeBytes(byte[] bytes, int i, int i1) {
   StreamItem item = new StreamItem();
   byte[] subBytes = ByteArrays.extractSubBytes(bytes, i, i1);
   item.byteArrayValue(subBytes);
   items.add(item);
 }
Example #4
0
 public void writeDouble(double v) {
   StreamItem item = new StreamItem();
   item.doubleValue(v);
   items.add(item);
 }
Example #5
0
 public void writeString(String s) {
   StreamItem item = new StreamItem();
   item.stringValue(s);
   items.add(item);
 }
Example #6
0
 public void writeLong(long l) {
   StreamItem item = new StreamItem();
   item.longValue(l);
   items.add(item);
 }
Example #7
0
 public void writeFloat(float v) {
   StreamItem item = new StreamItem();
   item.floatValue(v);
   items.add(item);
 }
Example #8
0
 public void writeInt(int i) {
   StreamItem item = new StreamItem();
   item.intValue(i);
   items.add(item);
 }
Example #9
0
 public void writeChar(char c) {
   StreamItem item = new StreamItem();
   item.charValue(c);
   items.add(item);
 }
Example #10
0
 public void writeShort(short i) {
   StreamItem item = new StreamItem();
   item.shortValue(i);
   items.add(item);
 }
Example #11
0
 public void writeByte(byte b) {
   StreamItem item = new StreamItem();
   item.byteValue(b);
   items.add(item);
 }
Example #12
0
 public void writeBoolean(boolean b) {
   StreamItem item = new StreamItem();
   item.booleanValue(b);
   items.add(item);
 }