Here you can find the source of truncateByteSegment(byte[] byteSegment, int toSize)
private static byte[] truncateByteSegment(byte[] byteSegment, int toSize)
//package com.java2s; /*// w ww. ja v a2s. c o m * Copyright (C) 1998, 2003 Gargoyle Software. All rights reserved. * * This file is part of GSBase. For details on use and redistribution * please refer to the license.html file included with these sources. */ public class Main { private static byte[] truncateByteSegment(byte[] byteSegment, int toSize) { byte[] newSegment = new byte[toSize]; System.arraycopy(byteSegment, 0, newSegment, 0, toSize); return newSegment; } }