Java ByteInputStream Problem

ยกเลิก โพสต์แล้ว Jan 29, 2009 ชำระเงินเมื่อจัดส่ง
ยกเลิก ชำระเงินเมื่อจัดส่ง

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.

วิศวกรรม Java Microsoft MySQL PHP สถาปัตยกรรมซอฟต์แวร์ การทดสอบซอฟต์แวร์ Windows Desktop

หมายเลขโปรเจค: #3588658

เกี่ยวกับโปรเจกต์

5 ข้อเสนอ โปรเจกต์ระยะไกล ใช้งาน %project.latestActivity_relativeTime|แทนที่%

freelancer 5 คน กำลังเสนอราคาในงานนี้ โดยมีราคาเฉลี่ยอยู่ที่ $6

TopOfStack

See private message.

$4.25 USD ใน 1 วัน
(192 รีวิว)
7.3
ricks7

See private message.

$8.5 USD ใน 1 วัน
(88 รีวิว)
5.2
egycodersvw

See private message.

$6.8 USD ใน 1 วัน
(45 รีวิว)
4.6
hirshah25

See private message.

$3.4 USD ใน 1 วัน
(7 รีวิว)
2.5
nadimpalliramesh

See private message.

$6.8 USD ใน 1 วัน
(0 รีวิว)
0.0