public void testReadingWritingNested()
throws Exception
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
BerSequenceGenerator sGen = new BerSequenceGenerator(bOut);
BerOctetStringGenerator octGen = new BerOctetStringGenerator(sGen.getRawOutputStream());
OutputStream out = octGen.getOctetOutputStream();
BerSequenceGenerator inSGen = new BerSequenceGenerator(out);
BerOctetStringGenerator inOctGen = new BerOctetStringGenerator(inSGen.getRawOutputStream());
OutputStream inOut = inOctGen.getOctetOutputStream();
inOut.write(new byte[] { 1, 2, 3, 4 });
inOut.write(new byte[10]);
inOut.close();