    @Test
    public void testEmptySubStream() throws Exception {

        ByteArrayOutputStream subOut = new ByteArrayOutputStream();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ProtoWriter pw = new ProtoWriter(out);
        pw.put(TEST_TAG_1);
        pw.put(CoreTags.TAG_STREAM, subOut);
        pw.put(TEST_TAG_2, "test");
        pw.flush();
        ProtoReader pr = new ProtoReader(new ByteArrayInputStream(out.toByteArray()));
        assertEquals(TEST_TAG_1, pr.getNextTag());
        byte[] subStreamData = pr.getSubStreamData();
        assertTrue(subStreamData != null);
        assertEquals(0, subStreamData.length);
        assertEquals(TEST_TAG_2, pr.getNextTag());
        String readTestData = pr.getString();
        assertEquals("test", readTestData);
        
        ProtoNode node = ProtoDOMBuilder.buildDOM(out.toByteArray());
    }