protected void writeAMF3ByteArray(byte[] bytes) throws IOException { if (debugMore) logMore.debug("writeAMF3ByteArray(bytes=%s)", bytes); write(AMF3_BYTEARRAY); int index = indexOfStoredObjects(bytes); if (index >= 0) writeAMF3IntegerData(index << 1); else { addToStoredObjects(bytes); writeAMF3IntegerData(bytes.length << 1 | 0x01); //write(bytes); for (int i = 0; i < bytes.length; i++) out.write(bytes[i]); } }
protected void writeAMF3Date(Date date) throws IOException { if (debugMore) logMore.debug("writeAMF3Date(date=%s)", date); write(AMF3_DATE); int index = indexOfStoredObjects(date); if (index >= 0) writeAMF3IntegerData(index << 1); else { addToStoredObjects(date); writeAMF3IntegerData(0x01); writeDouble(date.getTime()); } }
protected void writeAMF3Array(Object array) throws IOException { if (debugMore) logMore.debug("writeAMF3Array(array=%s)", array); write(AMF3_ARRAY); int index = indexOfStoredObjects(array); if (index >= 0) writeAMF3IntegerData(index << 1); else { addToStoredObjects(array); int length = Array.getLength(array); writeAMF3IntegerData(length << 1 | 0x01); write(0x01); for (int i = 0; i < length; i++) writeObject(Array.get(array, i)); } }
protected void writeAMF3Integer(int i) throws IOException { if (debugMore) logMore.debug("writeAMF3Integer(i=%d)", i); if (i < AMF3_INTEGER_MIN || i > AMF3_INTEGER_MAX) { if (debugMore) logMore.debug("writeAMF3Integer() - %d is out of AMF3 int range, writing it as a Number", i); writeAMF3Number(i); } else { write(AMF3_INTEGER); writeAMF3IntegerData(i); } }
protected void writeAMF3Xml(Document doc) throws IOException { if (debugMore) logMore.debug("writeAMF3Xml(doc=%s)", doc); byte xmlType = AMF3_XMLSTRING; Channel channel = getChannel(); if (channel != null && channel.isLegacyXmlSerialization()) xmlType = AMF3_XML; write(xmlType); int index = indexOfStoredObjects(doc); if (index >= 0) writeAMF3IntegerData(index << 1); else { addToStoredObjects(doc); byte[] bytes = xmlUtil.toString(doc).getBytes("UTF-8"); writeAMF3IntegerData((bytes.length << 1) | 0x01); write(bytes); } }
writeAMF3IntegerData(index << 1); else { addToStoredStrings(s); uLength += 2; writeAMF3IntegerData((uLength << 1) | 0x01);
writeAMF3IntegerData(index << 1); else { addToStoredObjects(o); if (iDesc != null) { desc = iDesc.getDescriptor(); writeAMF3IntegerData(iDesc.getIndex() << 2 | 0x01); desc = iDesc.getDescriptor(); writeAMF3IntegerData((desc.getPropertiesCount() << 4) | (desc.getEncoding() << 2) | 0x03); writeAMF3StringData(desc.getName());