Java examples for java.io:OutputStream
write Ascii String to OutputStream
//package com.java2s; import java.io.IOException; import java.io.OutputStream; public class Main { public static void writeOVMAsciiString(OutputStream os, String toWrite) throws IOException { int length = toWrite.length() < 256 ? toWrite.length() : 255; os.write(length);// www. j a v a2 s . c om for (int i = 0; i < length; ++i) { int code = toWrite.charAt(i); os.write(code); } } }