/** * Writes Array Object - call <code>writeData</code> foreach element * * @param array * @throws IOException */ protected void writeArray(Object[] array) throws IOException { dataOutputStream.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutputStream.writeInt(array.length); for (int i = 0; i < array.length; i++) { writeData(array[i]); } }
/** * Writes Array Object - call <code>writeData</code> foreach element * * @param array * @throws IOException */ protected void writeArray(Object[] array) throws IOException { dataOutput.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutput.writeInt(array.length); for (int i = 0; i < array.length; i++) { writeData(array[i]); } }
/** * Writes Array Object - call <code>writeData</code> foreach element * * @param array * @throws IOException */ protected void writeArray(Object[] array) throws IOException { dataOutput.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutput.writeInt(array.length); for (int i = 0; i < array.length; i++) { writeData(array[i]); } }
/** * Writes Array Object - call <code>writeData</code> foreach element * * @param array * @throws IOException */ protected void writeArray(Object[] array) throws IOException { dataOutput.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutput.writeInt(array.length); for (int i = 0; i < array.length; i++) { writeData(array[i]); } }
/** * Writes collection * * @param collection Collection * @throws IOException */ protected void write(Collection<?> collection) throws IOException { dataOutput.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutput.writeInt(collection.size()); for (Iterator<?> objects = collection.iterator(); objects.hasNext();) { Object object = objects.next(); writeData(object); } } /**
/** * Writes collection * * @param collection Collection * @throws IOException */ protected void write(Collection<?> collection) throws IOException { dataOutput.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutput.writeInt(collection.size()); for (Iterator<?> objects = collection.iterator(); objects.hasNext();) { Object object = objects.next(); writeData(object); } } /**
/** * Writes collection * * @param collection Collection * @throws IOException */ protected void write(Collection<?> collection) throws IOException { dataOutput.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutput.writeInt(collection.size()); for (Iterator<?> objects = collection.iterator(); objects.hasNext();) { Object object = objects.next(); writeData(object); } } /**
/** * Writes collection * * @param collection Collection * @throws IOException */ protected void write(Collection<?> collection) throws IOException { dataOutputStream.writeByte(AMF0Body.DATA_TYPE_ARRAY); dataOutputStream.writeInt(collection.size()); for (Iterator<?> objects = collection.iterator(); objects.hasNext();) { Object object = objects.next(); writeData(object); } } /**
/** * Writes message header * * @param header AMF message header * @throws IOException */ protected void writeHeader(AMF0Header header) throws IOException { dataOutput.writeUTF(header.getKey()); dataOutput.writeBoolean(header.isRequired()); // Always, always there is four bytes of FF, which is -1 of course dataOutput.writeInt(-1); writeData(header.getValue()); } /**
/** * Writes message header * * @param header AMF message header * @throws IOException */ protected void writeHeader(AMF0Header header) throws IOException { dataOutput.writeUTF(header.getKey()); dataOutput.writeBoolean(header.isRequired()); // Always, always there is four bytes of FF, which is -1 of course dataOutput.writeInt(-1); writeData(header.getValue()); } /**
/** * Writes message header * * @param header AMF message header * @throws IOException */ protected void writeHeader(AMF0Header header) throws IOException { dataOutput.writeUTF(header.getKey()); dataOutput.writeBoolean(header.isRequired()); // Always, always there is four bytes of FF, which is -1 of course dataOutput.writeInt(-1); writeData(header.getValue()); } /**
/** * Writes message header * * @param header AMF message header * @throws IOException */ protected void writeHeader(AMF0Header header) throws IOException { dataOutputStream.writeUTF(header.getKey()); dataOutputStream.writeBoolean(header.isRequired()); // Always, always there is four bytes of FF, which is -1 of course dataOutputStream.writeInt(-1); writeData(header.getValue()); } /**
/** * Writes Object Map * * @param map * @throws IOException */ protected void writeMap(Map<?, ?> map) throws IOException { if (map instanceof ASObject && ((ASObject) map).getType() != null) { log.debug("Writing Custom Class: %s", ((ASObject) map).getType()); dataOutputStream.writeByte(AMF0Body.DATA_TYPE_CUSTOM_CLASS); dataOutputStream.writeUTF(((ASObject) map).getType()); } else { log.debug("Writing Map"); dataOutputStream.writeByte(AMF0Body.DATA_TYPE_MIXED_ARRAY); dataOutputStream.writeInt(0); } for (Iterator<?> entrys = map.entrySet().iterator(); entrys.hasNext();) { Map.Entry<?, ?> entry = (Map.Entry<?, ?>)entrys.next(); log.debug("%s: %s", entry.getKey(), entry.getValue()); dataOutputStream.writeUTF(entry.getKey().toString()); writeData(entry.getValue()); } dataOutputStream.writeShort(0); dataOutputStream.writeByte(AMF0Body.DATA_TYPE_OBJECT_END); }
/** * Writes Object Map * * @param map * @throws IOException */ protected void writeMap(Map<?, ?> map) throws IOException { if (map instanceof ASObject && ((ASObject) map).getType() != null) { log.debug("Writing Custom Class: %s", ((ASObject) map).getType()); dataOutput.writeByte(AMF0Body.DATA_TYPE_CUSTOM_CLASS); dataOutput.writeUTF(((ASObject) map).getType()); } else { log.debug("Writing Map"); dataOutput.writeByte(AMF0Body.DATA_TYPE_MIXED_ARRAY); dataOutput.writeInt(0); } for (Iterator<?> entrys = map.entrySet().iterator(); entrys.hasNext();) { Map.Entry<?, ?> entry = (Map.Entry<?, ?>)entrys.next(); log.debug("%s: %s", entry.getKey(), entry.getValue()); dataOutput.writeUTF(entry.getKey().toString()); writeData(entry.getValue()); } dataOutput.writeShort(0); dataOutput.writeByte(AMF0Body.DATA_TYPE_OBJECT_END); }
/** * Writes Object Map * * @param map * @throws IOException */ protected void writeMap(Map<?, ?> map) throws IOException { if (map instanceof ASObject && ((ASObject) map).getType() != null) { log.debug("Writing Custom Class: %s", ((ASObject) map).getType()); dataOutput.writeByte(AMF0Body.DATA_TYPE_CUSTOM_CLASS); dataOutput.writeUTF(((ASObject) map).getType()); } else { log.debug("Writing Map"); dataOutput.writeByte(AMF0Body.DATA_TYPE_MIXED_ARRAY); dataOutput.writeInt(0); } for (Iterator<?> entrys = map.entrySet().iterator(); entrys.hasNext();) { Map.Entry<?, ?> entry = (Map.Entry<?, ?>)entrys.next(); log.debug("%s: %s", entry.getKey(), entry.getValue()); dataOutput.writeUTF(entry.getKey().toString()); writeData(entry.getValue()); } dataOutput.writeShort(0); dataOutput.writeByte(AMF0Body.DATA_TYPE_OBJECT_END); }
/** * Writes Object Map * * @param map * @throws IOException */ protected void writeMap(Map<?, ?> map) throws IOException { if (map instanceof ASObject && ((ASObject) map).getType() != null) { log.debug("Writing Custom Class: %s", ((ASObject) map).getType()); dataOutput.writeByte(AMF0Body.DATA_TYPE_CUSTOM_CLASS); dataOutput.writeUTF(((ASObject) map).getType()); } else { log.debug("Writing Map"); dataOutput.writeByte(AMF0Body.DATA_TYPE_MIXED_ARRAY); dataOutput.writeInt(0); } for (Iterator<?> entrys = map.entrySet().iterator(); entrys.hasNext();) { Map.Entry<?, ?> entry = (Map.Entry<?, ?>)entrys.next(); log.debug("%s: %s", entry.getKey(), entry.getValue()); dataOutput.writeUTF(entry.getKey().toString()); writeData(entry.getValue()); } dataOutput.writeShort(0); dataOutput.writeByte(AMF0Body.DATA_TYPE_OBJECT_END); }
/** * Writes message body * * @param body AMF message body * @throws IOException */ protected void writeBody(AMF0Body body) throws IOException { // write url if (body.getTarget() == null) { dataOutput.writeUTF(NULL_MESSAGE); } else { dataOutput.writeUTF(body.getTarget()); } // write response if (body.getResponse() == null) { dataOutput.writeUTF(NULL_MESSAGE); } else { dataOutput.writeUTF(body.getResponse()); } // Always, always there is four bytes of FF, which is -1 of course dataOutput.writeInt(-1); // Write the data to the output stream writeData(body.getValue()); }
/** * Writes message body * * @param body AMF message body * @throws IOException */ protected void writeBody(AMF0Body body) throws IOException { // write url if (body.getTarget() == null) { dataOutputStream.writeUTF(NULL_MESSAGE); } else { dataOutputStream.writeUTF(body.getTarget()); } // write response if (body.getResponse() == null) { dataOutputStream.writeUTF(NULL_MESSAGE); } else { dataOutputStream.writeUTF(body.getResponse()); } // Always, always there is four bytes of FF, which is -1 of course dataOutputStream.writeInt(-1); // Write the data to the output stream writeData(body.getValue()); }
/** * Writes message body * * @param body AMF message body * @throws IOException */ protected void writeBody(AMF0Body body) throws IOException { // write url if (body.getTarget() == null) { dataOutput.writeUTF(NULL_MESSAGE); } else { dataOutput.writeUTF(body.getTarget()); } // write response if (body.getResponse() == null) { dataOutput.writeUTF(NULL_MESSAGE); } else { dataOutput.writeUTF(body.getResponse()); } // Always, always there is four bytes of FF, which is -1 of course dataOutput.writeInt(-1); // Write the data to the output stream writeData(body.getValue()); }
/** * Writes message body * * @param body AMF message body * @throws IOException */ protected void writeBody(AMF0Body body) throws IOException { // write url if (body.getTarget() == null) { dataOutput.writeUTF(NULL_MESSAGE); } else { dataOutput.writeUTF(body.getTarget()); } // write response if (body.getResponse() == null) { dataOutput.writeUTF(NULL_MESSAGE); } else { dataOutput.writeUTF(body.getResponse()); } // Always, always there is four bytes of FF, which is -1 of course dataOutput.writeInt(-1); // Write the data to the output stream writeData(body.getValue()); }