"J M" <> wrote in message
news:FVOcd.7334$q% m...
>I am manually porting C# program to Java
>
> How do I write following C# function in java
> using(MemoryStream memStream=new MemoryStream())
There's no Java class corresponding precisely to MemoryStream:
ByteArrayInputStream and ByteArrayOutputStream are the closest.
using(x) translates, more or less, to
// declare x;
try
{
// body of using statement
}
finally
{
// dispose of x in some class-specific fashion.
// in the case, probably x.close();
}
|