Java Array Truncate truncateByteSegment(byte[] byteSegment, int toSize)

Here you can find the source of truncateByteSegment(byte[] byteSegment, int toSize)

Description

truncate Byte Segment

License

Open Source License

Declaration

private static byte[] truncateByteSegment(byte[] byteSegment, int toSize) 

Method Source Code

//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;
    }
}

Related

  1. truncate(int[] array, int maxLen)
  2. truncate(int[] values, int value)
  3. truncate(short[] value, int maxSize)
  4. truncateAndConvertToInt(long[] longArray)
  5. truncateBytes(byte[] inputBytes)
  6. truncateData(byte[] data, int numOfBytes)
  7. truncateHashToLong(byte[] bytes)
  8. truncateI(long[] v, int len)
  9. truncateLeft(byte[] b1, int bytes)