Java Byte Array from getBytesASCII(String s)

Here you can find the source of getBytesASCII(String s)

Description

get Bytes ASCII

License

Open Source License

Declaration

public static byte[] getBytesASCII(String s) 

Method Source Code


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

import java.io.UnsupportedEncodingException;

public class Main {
    public static byte[] getBytesASCII(String s) {
        try {//from  w ww. j  ava2s  . co m
            return s.getBytes("ASCII");
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e); // cannot happen
        }
    }
}

Related

  1. getBytes(ZipFile archive, ZipEntry entry)
  2. getBytes(ZipInputStream zipInputStream)
  3. getBytes2(InputStream aStream)
  4. getBytesAndClose(InputStream in)
  5. getBytesArrayFromFile(String fileName)
  6. getBytesAsTempFile(byte[] bytes)
  7. getBytesClassic(final int count, final InputStream is)
  8. getBytesFromArrayList(final ArrayList fileList)
  9. getBytesFromHexaText(String text)