@Override public void write(AMF3Serializer serializer, Object o) throws IOException { serializer.writeAMF3Integer(((Number)o).intValue()); } };
@Override public void write(AMF3Serializer serializer, Object o) throws IOException { serializer.writeAMF3Integer(((Number)o).intValue()); } };
@Override public void write(AMF3Serializer serializer, Object o) throws IOException { serializer.writeAMF3Integer(((Number)o).intValue()); } };
@Override public void writeObject(Object o) throws IOException { if (o != null) o = converters.revert(o); if (o == null) writeAMF3Null(); else { Class<?> cls = o.getClass(); if (cls == String.class) { writeAMF3String((String)o); return; } if (cls == Integer.class) { writeAMF3Integer(((Integer)o).intValue()); return; } if (cls == Boolean.class) { writeAMF3Boolean(((Boolean)o).booleanValue()); return; } AMF3Writer writer = writersCache.get(cls); if (writer == null) { writer = getWriter(cls); writersCache.put(cls, writer); } writer.write(this, o); } }
@Override public void writeObject(Object o) throws IOException { if (o != null) o = converters.revert(o); if (o == null) writeAMF3Null(); else { Class<?> cls = o.getClass(); if (cls == String.class) { writeAMF3String((String)o); return; } if (cls == Integer.class) { writeAMF3Integer(((Integer)o).intValue()); return; } if (cls == Boolean.class) { writeAMF3Boolean(((Boolean)o).booleanValue()); return; } AMF3Writer writer = writersCache.get(cls); if (writer == null) { writer = getWriter(cls); writersCache.put(cls, writer); } writer.write(this, o); } }
@Override public void writeObject(Object o) throws IOException { if (o != null) o = converters.revert(o); if (o == null) writeAMF3Null(); else { Class<?> cls = o.getClass(); if (cls == String.class) { writeAMF3String((String)o); return; } if (cls == Integer.class) { writeAMF3Integer(((Integer)o).intValue()); return; } if (cls == Boolean.class) { writeAMF3Boolean(((Boolean)o).booleanValue()); return; } AMF3Writer writer = writersCache.get(cls); if (writer == null) { writer = getWriter(cls); writersCache.put(cls, writer); } writer.write(this, o); } }
protected void writeAMF3IntArray(int[] array) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_ARRAY; int index = storedObjects.putIfAbsent(array); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(array.length << 1 | 0x01); ensureCapacity(1); buffer[position++] = 0x01; for (int i : array) writeAMF3Integer(i); } }
protected void writeAMF3ShortArray(short[] array) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_ARRAY; int index = storedObjects.putIfAbsent(array); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(array.length << 1 | 0x01); ensureCapacity(1); buffer[position++] = 0x01; for (short i : array) writeAMF3Integer(i); } }
protected void writeAMF3ShortArray(short[] array) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_ARRAY; int index = storedObjects.putIfAbsent(array); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(array.length << 1 | 0x01); ensureCapacity(1); buffer[position++] = 0x01; for (short i : array) writeAMF3Integer(i); } }
protected void writeAMF3IntArray(int[] array) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_ARRAY; int index = storedObjects.putIfAbsent(array); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(array.length << 1 | 0x01); ensureCapacity(1); buffer[position++] = 0x01; for (int i : array) writeAMF3Integer(i); } }
protected void writeAMF3ShortArray(short[] array) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_ARRAY; int index = storedObjects.putIfAbsent(array); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(array.length << 1 | 0x01); ensureCapacity(1); buffer[position++] = 0x01; for (short i : array) writeAMF3Integer(i); } }
protected void writeAMF3IntArray(int[] array) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_ARRAY; int index = storedObjects.putIfAbsent(array); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(array.length << 1 | 0x01); ensureCapacity(1); buffer[position++] = 0x01; for (int i : array) writeAMF3Integer(i); } }
else if (o instanceof Number) { if (o instanceof Integer || o instanceof Short || o instanceof Byte) writeAMF3Integer(((Number)o).intValue()); else if (externalizeLong && o instanceof Long) writeAMF3Object(o);