private static byte[] createEofBatchAndLocationRecord() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(EOF_INT); os.writeByte(EOF_EOT); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create eof header.", e); } }
private static byte[] createBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create batch control record header.", e); } }
private static byte[] createEmptyBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); os.writeInt(0); os.writeLong(0l); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create empty batch control record header.", e); } }
@Override public void marshal(Object o, HierarchicalStreamWriter hierarchicalStreamWriter, MarshallingContext marshallingContext) { ByteSequence byteSequence = (ByteSequence)o; byteSequence.compact(); delegate.marshal(byteSequence, hierarchicalStreamWriter, marshallingContext); }
@Override public void marshal(Object o, HierarchicalStreamWriter hierarchicalStreamWriter, MarshallingContext marshallingContext) { ByteSequence byteSequence = (ByteSequence)o; byteSequence.compact(); delegate.marshal(byteSequence, hierarchicalStreamWriter, marshallingContext); }
@Override public void marshal(Object o, HierarchicalStreamWriter hierarchicalStreamWriter, MarshallingContext marshallingContext) { ByteSequence byteSequence = (ByteSequence)o; byteSequence.compact(); delegate.marshal(byteSequence, hierarchicalStreamWriter, marshallingContext); }
private static void putMsgOriginalDestination(final ActiveMQDestination origDest, final WireFormat marshaller, final CoreMessage coreMessage) throws IOException { final ByteSequence origDestBytes = marshaller.marshal(origDest); origDestBytes.compact(); coreMessage.putBytesProperty(AMQ_MSG_ORIG_DESTINATION, origDestBytes.data); }
private static void putMsgDataStructure(final DataStructure ds, final WireFormat marshaller, final CoreMessage coreMessage) throws IOException { final ByteSequence dsBytes = marshaller.marshal(ds); dsBytes.compact(); coreMessage.putBytesProperty(AMQ_MSG_DATASTRUCTURE, dsBytes.data); }
private static void putMsgReplyTo(final ActiveMQDestination replyTo, final WireFormat marshaller, final CoreMessage coreMessage) throws IOException { final ByteSequence replyToBytes = marshaller.marshal(replyTo); replyToBytes.compact(); coreMessage.putBytesProperty(AMQ_MSG_REPLY_TO, replyToBytes.data); }
private static void putMsgMarshalledProperties(final ByteSequence propBytes, final Message messageSend, final CoreMessage coreMessage) throws IOException { propBytes.compact(); coreMessage.putBytesProperty(AMQ_MSG_MARSHALL_PROP, propBytes.data); //unmarshall properties to core so selector will work final Map<String, Object> props = messageSend.getProperties(); if (!props.isEmpty()) { props.forEach((key, value) -> { try { coreMessage.putObjectProperty(key, value); } catch (ActiveMQPropertyConversionException e) { coreMessage.putStringProperty(key, value.toString()); } }); } }
private static byte[] createEofBatchAndLocationRecord() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(EOF_INT); os.writeByte(EOF_EOT); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create eof header.", e); } }
private static byte[] createEofBatchAndLocationRecord() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(EOF_INT); os.writeByte(EOF_EOT); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create eof header.", e); } }
private static byte[] createEofBatchAndLocationRecord() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(EOF_INT); os.writeByte(EOF_EOT); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create eof header.", e); } }
private static byte[] createBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create batch control record header.", e); } }
private static byte[] createBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create batch control record header.", e); } }
private static byte[] createBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create batch control record header.", e); } }
private static byte[] createEmptyBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); os.writeInt(0); os.writeLong(0l); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create empty batch control record header.", e); } }
private static byte[] createEmptyBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); os.writeInt(0); os.writeLong(0l); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create empty batch control record header.", e); } }
private static byte[] createEmptyBatchControlRecordHeader() { try (DataByteArrayOutputStream os = new DataByteArrayOutputStream();) { os.writeInt(BATCH_CONTROL_RECORD_SIZE); os.writeByte(BATCH_CONTROL_RECORD_TYPE); os.write(BATCH_CONTROL_RECORD_MAGIC); os.writeInt(0); os.writeLong(0l); ByteSequence sequence = os.toByteSequence(); sequence.compact(); return sequence.getData(); } catch (IOException e) { throw new RuntimeException("Could not create empty batch control record header.", e); } }