protected void writeAMF3VectorNumber(AMFVectorNumberValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_NUMBER; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToLongBits(((Number)Array.get(o, i)).doubleValue())); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToLongBits(((Number)item).doubleValue())); } } } }
protected void writeAMF3VectorNumber(AMFVectorNumberValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_NUMBER; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToLongBits(((Number)Array.get(o, i)).doubleValue())); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToLongBits(((Number)item).doubleValue())); } } } }
protected void writeAMF3VectorNumber(AMFVectorNumberValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_NUMBER; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToLongBits(((Number)Array.get(o, i)).doubleValue())); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(8); position = writeLongData(buffer, position, Double.doubleToLongBits(((Number)item).doubleValue())); } } } }
protected void writeAMF3VectorInt(AMFVectorIntValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_INT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)Array.get(o, i)).intValue()); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)item).intValue()); } } } }
protected void writeAMF3VectorUint(AMFVectorUintValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_UINT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)Array.get(o, i)).intValue()); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)item).intValue()); } } } }
protected void writeAMF3VectorUint(AMFVectorUintValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_UINT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)Array.get(o, i)).intValue()); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)item).intValue()); } } } }
protected void writeAMF3VectorInt(AMFVectorIntValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_INT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)Array.get(o, i)).intValue()); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)item).intValue()); } } } }
protected void writeAMF3VectorObject(AMFVectorObjectValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_OBJECT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); writeAMF3StringData(value.type); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) writeObject(Array.get(o, i)); } else { for (Object item : (Collection<?>)o) writeObject(item); } } }
protected void writeAMF3VectorInt(AMFVectorIntValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_INT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)Array.get(o, i)).intValue()); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)item).intValue()); } } } }
protected void writeAMF3VectorUint(AMFVectorUintValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_UINT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)Array.get(o, i)).intValue()); } } else { for (Object item : (Collection<?>)o) { ensureCapacity(4); position = writeIntData(buffer, position, ((Number)item).intValue()); } } } }
protected void writeAMF3VectorObject(AMFVectorObjectValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_OBJECT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); writeAMF3StringData(value.type); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) writeObject(Array.get(o, i)); } else { for (Object item : (Collection<?>)o) writeObject(item); } } }
protected void writeAMF3VectorObject(AMFVectorObjectValue value) throws IOException { ensureCapacity(1); buffer[position++] = AMF3_VECTOR_OBJECT; Object o = value.value; int index = storedObjects.putIfAbsent(o); if (index >= 0) writeAMF3UnsignedIntegerData(index << 1); else { int length = getArrayOrCollectionLength(o); writeAMF3UnsignedIntegerData(length << 1 | 0x01); ensureCapacity(1); buffer[position++] = (byte)(value.fixed ? 0x01 : 0x00); writeAMF3StringData(value.type); if (o.getClass().isArray()) { for (int i = 0; i < length; i++) writeObject(Array.get(o, i)); } else { for (Object item : (Collection<?>)o) writeObject(item); } } }