FIXTags { public static int get(ByteBuffer buffer) { int tag = 0; while (buffer.hasRemaining()) { byte b = buffer.get(); if (b == EQUALS) return tag; tag = 10 * tag + b - '0'; } return 0; } private  FIXTags(); static int get(ByteBuffer buffer); static void put(ByteBuffer buffer, int tag);  }
@Test public void get() { assertEquals(123, FIXTags.get(ByteBuffers.wrap("123="))); }
@Test public void getPartial() { assertEquals(0, FIXTags.get(ByteBuffers.wrap("123"))); }