Here you can find the source of getNextTagNum(ByteBuffer message)
Parameter | Description |
---|---|
message | IX message wrapped in a ByteBuffer |
public static int getNextTagNum(ByteBuffer message)
//package com.java2s; /*//from w w w.j a v a 2 s . com * Copyright (c) 2006-2016 Marvisan Pty. Ltd. All rights reserved. * Use is subject to license terms. */ import java.nio.ByteBuffer; public class Main { /** * Gets the next tag. Assumes that the buffer position is located at the beginning of the * tag to retrieve. The given FIX message buffer pointer is advanced to the tag value. * @param message IX message wrapped in a ByteBuffer * @return next tag */ public static int getNextTagNum(ByteBuffer message) { StringBuilder builder = new StringBuilder(10); int b; message.mark(); while (message.hasRemaining()) { if ((b = message.get()) == ((int) '=')) { break; } else { builder.append((char) b); } } return Integer.parseInt(builder.toString()); } }