Android Byte Array to String Convert getString(byte[] fromBytes, int offset, int length)

Here you can find the source of getString(byte[] fromBytes, int offset, int length)

Description

get String

License

Open Source License

Declaration

public static String getString(byte[] fromBytes, int offset, int length) 

Method Source Code

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

import java.io.UnsupportedEncodingException;

public class Main {
    public static final String BYTE_CHARSET = "UTF-8";

    public static String getString(byte[] fromBytes, int offset, int length) {
        final String toString;

        try {//from   w  w w . j  av a 2  s  .c o m
            toString = new String(fromBytes, offset, length, BYTE_CHARSET);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }

        return toString;
    }
}

Related

  1. bytes2String(byte[] data, String type)
  2. bytes2StringPtr(byte[] data, String type)
  3. getString(byte[] bb)
  4. getString(byte[] bytes)
  5. getString(byte[] bytes, String charsetName)
  6. getString(byte[] originalByte, int start, int length)
  7. getString(byte[] value)
  8. getStringByByteArray(byte[] b)
  9. toByteString(byte[] bytes)