Java Byte Array from getBytesISO88591(String s)

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

Description

get Bytes ISO

License

Open Source License

Declaration

public static byte[] getBytesISO88591(String s) 

Method Source Code


//package com.java2s;
import java.io.UnsupportedEncodingException;

public class Main {
    public static byte[] getBytesISO88591(String s) {
        return getBytes(s, "ISO-8859-1");
    }//from ww  w  .  ja  va 2s. c o  m

    public static byte[] getBytes(String s, String charset) {
        try {
            return s.getBytes(charset);
        } catch (UnsupportedEncodingException e) {
        }
        return null;
    }
}

Related

  1. getBytesFromStream(int length, ByteArrayInputStream bais)
  2. getBytesFromString(final String str, final int length, final String coding)
  3. getBytesFromText(String text, String charset)
  4. getBytesInCodePage(final String string, final int codepage)
  5. getBytesInUsAscii(String s)
  6. getBytesLengthOfEncoding(String encoding, String str)
  7. getByteString(RandomAccessFile inputStream, int numBytesToRead)