public MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length) { if (tag == TEST_REQ_ID) { this.testReqId = buffer.getAscii(offset, length); } return MessageControl.CONTINUE; }
public void wrap(final DirectBuffer buffer, final int offset, final int length) { this.buffer.wrap(buffer); this.offset = offset; this.length = length; }
private boolean validChecksum(final int offset, final int messageChecksum) { if (messageChecksum == NO_CHECKSUM) { return false; } final int correctChecksum = string.computeChecksum(offset, checksumOffset); return correctChecksum == messageChecksum; } }
public MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length) { switch (tag) { // You switch on the tag in order to decode what field data has arrived. case 54: wantsToSell = buffer.getByte(offset) == '2'; break; case 55: symbol = buffer.getStringUtf8(offset, length); break; // Implement other tags in order to // Optional fields will either generate callbacks or not depending upon whether they // are present in the message. } return MessageControl.CONTINUE; }
final int endMonth = endYear + SIZE_OF_MONTH; final int year = buffer.getNatural(offset, endYear); final int month = buffer.getNatural(endYear, endMonth); if (buffer.getChar(endMonth) == 'w') final int weekOfMonth = buffer.getNatural(startWeek, endWeek); final int dayOfMonth = buffer.getNatural(endMonth, endDay);
public MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length) { switch (tag) { case Constants.POSS_DUP_FLAG: possDupOffset = offset; break; case Constants.SENDING_TIME: sendingTimeEnd = offset + length + 1; break; case Constants.BODY_LENGTH: bodyLengthOffset = offset; lengthOfBodyLength = length; bodyLength = buffer.getInt(offset, offset + length); break; } return MessageControl.CONTINUE; }
public char[] toCharArray() { final char[] characters = new char[length]; for (int i = 0; i < length; i++) { characters[i] = buffer.getChar(i + offset); } return characters; }
public byte[] toByteArray() { final byte[] bytes = new byte[length]; buffer.getBytes(offset, bytes); return bytes; }
public MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length) { switch (tag) { case Constants.POSS_DUP_FLAG: possDupOffset = offset; break; case Constants.SENDING_TIME: sendingTimeOffset = offset; sendingTimeLength = length; break; case Constants.ORIG_SENDING_TIME: origSendingTimeOffset = offset; origSendingTimeLength = length; break; case Constants.BODY_LENGTH: bodyLengthOffset = offset; lengthOfBodyLength = length; bodyLength = buffer.getInt(offset, offset + length); break; } return MessageControl.CONTINUE; }
public long decode(final byte[] bytes, final int length) { buffer.wrap(bytes); return decode(buffer, 0, length); }
protected boolean matchesSafely(final AsciiBuffer item) { this.string = item.getAscii(offset, length); return expectedValue.equals(string); }
public long decode(final byte[] bytes, final int length) { buffer.wrap(bytes); return decode(buffer, 0, length); }
public synchronized MessageControl onField( final int tag, final AsciiBuffer buffer, final int offset, final int length) { DebugLogger.log(FIX_TEST, "Field: %s=%s%n", tag, buffer, offset, length); if (tag == Constants.SENDER_COMP_ID) { senderCompId = buffer.getAscii(offset, length); } message.put(tag, buffer.getAscii(offset, length)); return MessageControl.CONTINUE; }
public long decodeMicros(final byte[] bytes, final int length) { buffer.wrap(bytes); return decodeMicros(buffer, 0, length); }
public int decode(final byte[] bytes) { flyweight.wrap(bytes); return decode(flyweight, 0); }
public long decodeMicros(final byte[] bytes, final int length) { buffer.wrap(bytes); return decodeMicros(buffer, 0, length); }
public int decode(final byte[] bytes) { buffer.wrap(bytes); return decode(buffer, 0, 1); }
public Action onMessage( final DirectBuffer buffer, final int offset, final int length, final int libraryId, final Session session, final int sequenceIndex, final int messageType, final long timestampInNs, final long position) { string.wrap(buffer); System.out.printf("%d -> %s%n", session.id(), printer.toString(string, offset, length, messageType)); return CONTINUE; }
public ControlledFragmentHandler.Action onMessage( final DirectBuffer buffer, final int offset, final int length, final int libraryId, final Session session, final int sequenceIndex, final int messageType, final long timestampInNs, final long position) { if (StressConfiguration.PRINT_EXCHANGE) { string.wrap(buffer); System.out.printf("%d -> %s%n", session.id(), printer.toString(string, offset, length, messageType)); } return CONTINUE; }