Code example for ObjectInputStream

Methods: readByte

0
	public void test_10_writeByte() { 
		// Test for method void java.io.ObjectOutputStream.writeByte(int) 
		try { 
			oos.writeByte(127);
			oos.close();
			ois = new ObjectInputStream(loadStream());
			assertEquals("Wrote incorrect byte value", 127, ois.readByte());
		} catch (IOException e) {
			fail("IOException serializing data : " + e.getMessage());
		} 
	} 
 
	public void test_11_writeBytes() { 
		// Test for method void 
		// java.io.ObjectOutputStream.writeBytes(java.lang.String) 
		try { 
			byte[] buf = new byte[10];
			oos.writeBytes("HelloWorld");
			oos.close();
			ois = new ObjectInputStream(loadStream());
			ois.readFully(buf);