Java String Shorten shorten(byte[] array, int length)

Here you can find the source of shorten(byte[] array, int length)

Description

shorten

License

Open Source License

Declaration

public static byte[] shorten(byte[] array, int length) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte[] shorten(byte[] array, int length) {
        if (length == array.length) {
            return array;
        }//ww w . j  a v  a 2s .  c o  m
        byte[] result = new byte[length];
        System.arraycopy(array, 0, result, 0, length);
        return result;
    }
}

Related

  1. shorten(String className)
  2. shorten(String className)
  3. shorten(String clazz)
  4. shorten(String fullClassName)