Code example for ByteArrayInputStream

Methods: close

0
	public MatrixData getB_RowB() { 
		return B_RowB;
	} 
 
	public void fromBytes(byte[] bytes) throws SerializationException {
		ByteArrayInputStream baInputStream = new ByteArrayInputStream(bytes);
		DataInputStream din = new DataInputStream(baInputStream);
 
		try { 
			int len=0;
			byte[] data = null;
			len=din.readInt();
			data = new byte[len];
			din.readFully(data);
			A_RowB=new MatrixData(data);
			 
			len=din.readInt();
			data = new byte[len];
			din.readFully(data);
			B_RowB=new MatrixData(data);	
		 
			din.close();
			baInputStream.close();
 
		} catch (IOException ioe) {
			throw new SerializationException(ioe);
		} 
	}