Code example for ByteArrayOutputStream

Methods: close

0
	} 
 
	@Override 
	@Test(enabled = false) 
	public void cycle() throws IOException { 
		ByteArrayOutputStream ba = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(ba);
 
		try { 
			oos.writeInt(300);
			oos.writeBoolean(true);
			oos.writeUTF("Questa e una prova di scrittura di una stringa");
			oos.writeFloat(3.0f);
			oos.writeLong(30000000L);
		} finally { 
			oos.close();
			ba.close();
		} 
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java