cancel
Showing results for 
Search instead for 
Did you mean: 

How copy an Inputstream object

Former Member
0 Kudos

Hi everybody,

how can i make a copy of an Inputstream object?

regards,

Sid

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You should probably "Read" this InputStream and save your byte[] after that, not really persist the InputStream object.

Regards,

Daniel

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

i solve the problem without a 2D array by putting the first array into a arraylist.

regards,

Sid

Former Member
0 Kudos

Hi,

Can you tell me why do you want to copy the stream and let me know your requirement.

Regards,

Naga

Former Member
0 Kudos

Hi Naga,

with the first inputstream i want to count the number of <item>-tags and with the second inputstream i want to parse the xml-file. I have to count the number of the element: <item> </item> for my array length. Because every <item>-tag is a row. So i have to define the array length before i start to parse the xml.


String [ ] [ ] items = [?] [ 4 ] 
{code }


Every <item> is a row. 


<?xml version="1.0" encoding="UTF-8"?>

<!-- Header Part -->

<quoteDoc>

<head>

.....

</head>

<positions>

<item> <---- first row in array

<a>123</a>

..

<d>xmz></d>

</item>

<item> <---- second row in array

<a>456</a>

.....

<d>xyz></d>

</item>

</positions>

</quoteDoc>

regards,

Sid

Former Member
0 Kudos

Hi,

You can juast declare a temporary variable of type java.io.InputStream for reference and assign the uploaded resource input stream to it.

Regards,

Naga