protected void writeAMF3Null() throws IOException { ensureCapacity(1); buffer[position++] = AMF3_NULL; }
protected void writeAMF3Boolean(boolean value) throws IOException { ensureCapacity(1); buffer[position++] = (value ? AMF3_BOOLEAN_TRUE : AMF3_BOOLEAN_FALSE); }
protected void writeAMF3String(String s) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_STRING; writeAMF3StringData(s); }
protected void writeAMF3Number(double d) throws IOException { ensureCapacity(9); buffer[position++] = AMF3_NUMBER; position = writeLongData(buffer, position, Double.doubleToLongBits(d)); }
protected void writeAMF3Number(double d) throws IOException { ensureCapacity(9); buffer[position++] = AMF3_NUMBER; position = writeLongData(buffer, position, Double.doubleToLongBits(d)); }
protected void writeAMF3String(String s) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_STRING; writeAMF3StringData(s); }
protected void writeAMF3String(String s) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_STRING; writeAMF3StringData(s); }
protected void writeAMF3Number(double d) throws IOException { ensureCapacity(9); buffer[position++] = AMF3_NUMBER; position = writeLongData(buffer, position, Double.doubleToLongBits(d)); }
protected void writeAMF3Date(Date date) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_DATE; int index = storedObjects.putIfAbsent(date); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(0x01); ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToRawLongBits(date.getTime())); } }
protected void writeAMF3Date(Date date) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_DATE; int index = storedObjects.putIfAbsent(date); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(0x01); ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToRawLongBits(date.getTime())); } }
protected void writeAMF3Date(Date date) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_DATE; int index = storedObjects.putIfAbsent(date); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(0x01); ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToRawLongBits(date.getTime())); } }
protected void writeAMF3Integer(int i) throws IOException { if (i < AMF3_INTEGER_MIN || i > AMF3_INTEGER_MAX) writeAMF3Number(i); else { ensureCapacity(1); buffer[position++] = AMF3_INTEGER; writeAMF3UnsignedIntegerData(i & AMF3_SIGNED_INTEGER_MASK); } }
protected void writeAMF3Integer(int i) throws IOException { if (i < AMF3_INTEGER_MIN || i > AMF3_INTEGER_MAX) writeAMF3Number(i); else { ensureCapacity(1); buffer[position++] = AMF3_INTEGER; writeAMF3UnsignedIntegerData(i & AMF3_SIGNED_INTEGER_MASK); } }
protected void writeAMF3Integer(int i) throws IOException { if (i < AMF3_INTEGER_MIN || i > AMF3_INTEGER_MAX) writeAMF3Number(i); else { ensureCapacity(1); buffer[position++] = AMF3_INTEGER; writeAMF3UnsignedIntegerData(i & AMF3_SIGNED_INTEGER_MASK); } }
protected void writeAMF3DoubleArray(double[] 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 (double i : array) writeAMF3Number(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 writeAMF3DoubleArray(double[] 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 (double i : array) writeAMF3Number(i); } }
protected void writeAMF3ByteArray(byte[] bytes) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_BYTEARRAY; int index = storedObjects.putIfAbsent(bytes); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(bytes.length << 1 | 0x01); flushBuffer(); out.write(bytes, 0, bytes.length); } }
protected void writeAMF3ByteArray(byte[] bytes) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_BYTEARRAY; int index = storedObjects.putIfAbsent(bytes); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(bytes.length << 1 | 0x01); flushBuffer(); out.write(bytes, 0, bytes.length); } }
protected void writeAMF3ByteArray(byte[] bytes) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_BYTEARRAY; int index = storedObjects.putIfAbsent(bytes); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { writeAMF3UnsignedIntegerData(bytes.length << 1 | 0x01); flushBuffer(); out.write(bytes, 0, bytes.length); } }