private static void tooLongValue() throws FIXValueOverflowException { throw new FIXValueOverflowException("Too long value"); }
/** * Read this value from a buffer. * * @param buffer a buffer * @throws FIXValueOverflowException if the length of the value exceeds * the capacity of this value container * @return true if a value was successfully read from the buffer, otherwise * false */ public boolean get(ByteBuffer buffer) throws FIXValueOverflowException { offset = 0; length = 0; while (buffer.hasRemaining()) { byte b = buffer.get(); bytes[length] = b; if (b == SOH) return true; if (++length == bytes.length) throw new FIXValueOverflowException("Too long value"); } return false; }