Hm... Normally I would consider Java being weird since the obvious thing (for me) to happen when closing a stream (like a file) is not to have access to its data. But I see now that C# supports this too for MemoryStream: http://stackoverflow.com/a/8100653 Haven't seen this before! I guess it makes some sense for this type of stream. I was using another method to access the data and I got what I initially expected...
C# is a wonderful language. There are also many goodies in it and around it like LINQ, PPL and the lovely VS IDE (with all of its add-ons). If you don't have a problem with MS, it's pure joy! Thanks a lot! I'll try saving the byte array to the file and let's hope I won't have to bug you anymore... > On Wed, 05 Jun 2013 16:27:26 +0200, _ <k...@dataverse.gr> wrote: > >> But a memory stream is already bytes in memory and if it gets closed I >> can't access them. > > I didn't know C# was that weird. > > In Java you create a ByteArrayOutputStream like this: > > ByteArrayOutputStream baos = new ByteArrayOutputStream(); > > You write plenty of bytes to baos, then you do: > > baos.flush(); > baos.close(); > > Now the ByteArrayOutputStream can't change anymore and it's safe to get > the bytes: > > baos.toByteArray(); > > I don't understand why C# wouldn't allow you to get the bytes from a > closed byte stream. > Then again, I've never written code in C#. > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > iText(R) is a registered trademark of 1T3XT BVBA. > Many questions posted to this list can (and will) be answered with a > reference to the iText book: http://www.itextpdf.com/book/ > Please check the keywords list before you ask for examples: > http://itextpdf.com/themes/keywords.php > ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php