Here you can find the source of loadTestPackets(final Path path)
public static byte[] loadTestPackets(final Path path) throws Exception
//package com.java2s; /*/*from ww w . j a v a 2 s. co m*/ * Copyright 2004-2016 EPAM Systems * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). * If not, see <http://www.gnu.org/licenses/>. */ import java.io.File; import java.io.FileInputStream; import java.nio.file.Path; public class Main { public static byte[] loadTestPackets(final Path path) throws Exception { final File file = path.toFile(); final int size = (int) file.length(); final byte[] data = new byte[size]; final FileInputStream in = new FileInputStream(file); in.read(data); in.close(); return data; } }