Here you can find the source of newOutputStream()
public static void newOutputStream()
//package com.java2s; //License from project: LGPL import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; public class Main { public static DataOutputStream dataOS; public static ByteArrayOutputStream byteArrayOS; public static void newOutputStream() { byteArrayOS = new ByteArrayOutputStream(); dataOS = new DataOutputStream(byteArrayOS); }//from www .j ava 2 s . c om }