Class ChunkReader.StreamChunkIterator

  • All Implemented Interfaces:
    java.util.Iterator<byte[]>
    Enclosing class:
    ChunkReader

    private static class ChunkReader.StreamChunkIterator
    extends java.lang.Object
    implements java.util.Iterator<byte[]>
    Iterator reading JFR chunks from a stream.
    • Field Detail

      • inputStream

        private final java.io.DataInputStream inputStream
      • lastError

        private java.lang.Throwable lastError
    • Constructor Detail

      • StreamChunkIterator

        public StreamChunkIterator​(java.io.InputStream inputStream)
    • Method Detail

      • getDataStream

        private java.io.DataInputStream getDataStream​(java.io.InputStream is)
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<byte[]>
      • validateJFRMagic

        private boolean validateJFRMagic()
      • next

        public byte[] next()
        Specified by:
        next in interface java.util.Iterator<byte[]>
      • retrieveNextChunk

        private byte[] retrieveNextChunk()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • readBytesFromStream

        private void readBytesFromStream​(byte[] bytes,
                                         int offset,
                                         int count)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<byte[]>