Code example for ByteArrayInputStream

Methods: close

0
	 */ 
	private static String bytesToString(byte[] bytes) {
		if (bytes == null) {
			return null; 
		} 
		ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
		DataInputStream dis = new DataInputStream(bais);
		String res = "";
		try { 
			res = dis.readUTF();
		} catch (IOException ex) {
		} finally { 
			try { 
				dis.close();
				bais.close();
			} catch (IOException ex1) {
			} 
			dis = null;
			bais = null;
		} 
		return res;