Java ASCII from toAsciiString(byte[] buffer, int startPos, int length)

Here you can find the source of toAsciiString(byte[] buffer, int startPos, int length)

Description

to Ascii String

License

Apache License

Declaration

public static final String toAsciiString(byte[] buffer, int startPos, int length) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static final String toAsciiString(byte[] buffer, int startPos, int length) {
        char[] charArray = new char[length];
        int readpoint = startPos;

        for (int i = 0; i < length; i++) {
            charArray[i] = (char) buffer[readpoint];
            readpoint++;//from  w ww  .j a va 2s .c  om
        }

        return new String(charArray);
    }

    public static final String toAsciiString(byte[] buffer) {
        return toAsciiString(buffer, 0, buffer.length);
    }
}

Related

  1. toAsciiChar(int i)
  2. toASCIICode(byte[] bts)
  3. toAsciiFilename(String string)
  4. toAsciiLowerCase(char ch)
  5. toAsciiString(byte[] buffer)
  6. toAsciiString(byte[] bytes)
  7. toASCIIString(byte[] data)
  8. toAsciiString(byte[] output)
  9. toAsciiString(String s)