Code example for DataInputStream

Methods: available, readInt, readLong, readUTF

0
				+ new String(Base64.decodeBase64(strEncoded.getBytes())));
 
		InputStream is = new ByteArrayInputStream(
				Base64.decodeBase64(strEncoded.getBytes()));
		BufferedInputStream bos = new BufferedInputStream(is);
		DataInputStream oin = new DataInputStream(bos);
 
		System.out.println("Header");
		System.out.println(oin.readUTF());
		System.out.println(oin.readInt());
		System.out.println(oin.readInt());
		System.out.println(oin.readUTF());
		System.out.println(oin.readUTF());
		System.out.println(oin.readUTF());
		System.out.println(oin.readInt());
		System.out.println(oin.readInt());
		System.out.println(oin.readUTF());
		System.out.println(oin.readUTF());
		System.out.println(oin.readUTF());
		System.out.println(oin.readLong());
		System.out.println(oin.readUTF());
 
		System.out.println();
		System.out.println("Body");
		System.out.println(oin.readInt());
		System.out.println(oin.readInt());
		System.out.println(oin.readUTF());
		System.out.println(oin.readInt());
		System.out.println(oin.readInt());
		System.out.println(oin.readInt());
		System.out.println(oin.readInt());
 
		System.out.println();
		System.out.println("Remain");
		System.out.println(oin.available() + " bytes");
	} 
 
	public static File searchKeywords(String keywordFile) throws Exception {
		// DataInputStream ins=new DataOutputStream(); 
		// readRequest();