Android Byte Array to String Convert toStringWithLength(byte[] b, int pos, int length)

Here you can find the source of toStringWithLength(byte[] b, int pos, int length)

Description

to String With Length

Declaration

public static String toStringWithLength(byte[] b, int pos, int length) 

Method Source Code

//package com.java2s;

public class Main {

    public static String toStringWithLength(byte[] b, int pos, int length) {
        StringBuilder str = new StringBuilder();

        for (int i = 0; i < length; i++) {
            str.append((char) b[pos + i]);
        }//from   w ww  .j  av a2 s.c o  m

        String ret = str.toString();
        return ret;
    }
}

Related

  1. byteToString(int[] byteData)
  2. base16(byte[] data)
  3. ByteArrayToStringList(byte[] byteArray, int dataLength)
  4. toStringForm(byte[] arr)
  5. toStringUntil(byte[] b, int pos, byte until)
  6. printBytes(byte[] bytes, StringBuilder builder, int bytesPerLine)
  7. printBytes(byte[] bytes, int bytesPerLine)
  8. printBytes(byte[] data, String type)
  9. bytesToByteString(byte[] bytes)