Java ByteInputStream Problem
$5-10 USD
Dibayar saat pengiriman
I have some java code which reads in data from a file and parses it as follows: DataInputStream dis; byte[] packet; int start_offs; [url removed, login to view] = new DataInputStream(new ByteArrayInputStream(packet, start_offs, [url removed, login to view])); the code does: byte ContentType = [url removed, login to view](); to get the next piece of data as needed. Now, I need to keep this code to read the data from a file but there is another case where I have the Byte Array already in memory and do not need to read it into a file. How can I get the DataInputStream to use that Byte Array and read it as if it were a ByteArrayInputStream? I do not want to write the byte array out into a file & read it in again.
ID Proyek: #3588658