Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.IOException;
import java.io.OutputStream;

public class Main {

    public static void printTextValue(OutputStream out, String str) throws IOException {
        str = str.replaceAll("&", "&"); //$NON-NLS-1$ //$NON-NLS-2$
        str = str.replaceAll(">", ">"); //$NON-NLS-1$ //$NON-NLS-2$
        str = str.replaceAll("<", "&lt;"); //$NON-NLS-1$ //$NON-NLS-2$
        print(out, str);
    }

    public static void print(OutputStream out, String str) throws IOException {
        out.write(str.getBytes("UTF-8")); //$NON-NLS-1$
    }
}