Code example for ByteArrayInputStream

Methods: close

0
		byte[] data = getAsBinary(key);
		if (data != null) {
			ByteArrayInputStream bais = null;
			ObjectInputStream ois = null;
			try { 
				bais = new ByteArrayInputStream(data);
				ois = new ObjectInputStream(bais);
				Object reObject = ois.readObject();
				return reObject;
			} catch (Exception e) {
				e.printStackTrace();
				return null; 
			} finally { 
				try { 
					if (bais != null)
						bais.close();
				} catch (IOException e) {
					e.printStackTrace();
				} 
				try { 
					if (ois != null)
Stop searching for code, let great code find you!  Add Codota to your java IDE