Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;

public class Main {
    public static void main(String[] args) throws Exception {
        CharsetEncoder encoder = Charset.forName("US-ASCII").newEncoder();

        String response = "java2s.com";
        System.out.println(encoder.encode(CharBuffer.wrap(response)));
    }
}