/** * Read this message from a buffer. * * @param buffer a buffer * @return true if this message was successfully read from the buffer, * otherwise false * @throws FIXMessageOverflowException if the number of fields exceeds the * maximum number of fields * @throws FIXValueOverflowException if the length of a value exceeds the * capacity of the value container */ public boolean get(ByteBuffer buffer) throws FIXMessageOverflowException, FIXValueOverflowException { reset(); while (buffer.hasRemaining()) { if (count == tags.length) tooManyFields(); int tag = FIXTags.get(buffer); if (tag == 0) return false; tags[count] = tag; if (!values[count].get(buffer)) return false; count++; } return true; }
/** * Read this message from a buffer. * * @param buffer a buffer * @return true if this message was successfully read from the buffer, * otherwise false * @throws FIXMessageOverflowException if the number of fields exceeds the * maximum number of fields * @throws FIXValueOverflowException if the length of a value exceeds the * capacity of the value container */ public boolean get(ByteBuffer buffer) throws FIXMessageOverflowException, FIXValueOverflowException { reset(); while (buffer.hasRemaining()) { if (count == tags.length) throw new FIXMessageOverflowException("Too many fields"); int tag = FIXTags.get(buffer); if (tag == 0) return false; tags[count] = tag; if (!values[count].get(buffer)) return false; count++; } return true; }