public ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
/** * Creates a new ByteSequence that represents the marshaled form of the given Journal Command. * * @param command * The Journal Command that should be marshaled to bytes for writing. * * @return the byte representation of the given journal command. * * @throws IOException if an error occurs while serializing the command. */ protected ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
private Location store(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); Location location = journal.write(os.toByteSequence(), true); journal.setLastAppendLocation(location); return location; }
DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os);
public ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
public ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
public ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
/** * Creates a new ByteSequence that represents the marshaled form of the given Journal Command. * * @param command * The Journal Command that should be marshaled to bytes for writing. * * @return the byte representation of the given journal command. * * @throws IOException if an error occurs while serializing the command. */ protected ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
/** * Creates a new ByteSequence that represents the marshaled form of the given Journal Command. * * @param command * The Journal Command that should be marshaled to bytes for writing. * * @return the byte representation of the given journal command. * * @throws IOException if an error occurs while serializing the command. */ protected ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
/** * Creates a new ByteSequence that represents the marshaled form of the given Journal Command. * * @param command * The Journal Command that should be marshaled to bytes for writing. * * @return the byte representation of the given journal command. * * @throws IOException if an error occurs while serializing the command. */ protected ByteSequence toByteSequence(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); return os.toByteSequence(); }
private Location store(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); Location location = journal.write(os.toByteSequence(), true); journal.setLastAppendLocation(location); return location; }
private Location store(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); Location location = journal.write(os.toByteSequence(), true); journal.setLastAppendLocation(location); return location; }
private Location store(JournalCommand<?> data) throws IOException { int size = data.serializedSizeFramed(); DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1); os.writeByte(data.type().getNumber()); data.writeFramed(os); Location location = journal.write(os.toByteSequence(), true); journal.setLastAppendLocation(location); return location; }