Here you can find the source of writeV(ByteBuffer byteBuffer, List
public static void writeV(ByteBuffer byteBuffer, List<Integer> vint)
//package com.java2s; /*/*from www . j a v a 2s .c o m*/ * (C) 2007-2010 Alibaba Group Holding Limited. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ import java.nio.ByteBuffer; import java.util.List; public class Main { public static void writeV(ByteBuffer byteBuffer, List<Integer> vint) { if (vint == null) return; // write vector's length byteBuffer.putInt(vint.size()); // write content for (int i = 0; i < vint.size(); ++i) { byteBuffer.putInt(vint.get(i)); } } }