Class ParserStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class ParserStream
    extends java.io.InputStream
    • Constructor Summary

      Constructors 
      Constructor Description
      ParserStream​(@NotNull java.io.InputStream inputStream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkInt16​(int expected, java.lang.String error)  
      void checkInt8​(int expected, java.lang.String error)  
      void checkPos​(long expectedOffset, java.lang.String error)  
      long getPos()  
      void mark​(int len)  
      int read()  
      int read​(@org.jetbrains.annotations.NotNull byte[] b, int off, int len)  
      void readFully​(byte[] b)  
      void readFully​(byte[] b, int off, int len)  
      int readInt16()  
      int readInt32()  
      int[] readInt32Array​(int count)  
      int readInt8()  
      byte[] readInt8Array​(int count)  
      java.lang.String readString16Fixed​(int len)  
      long readUInt32()  
      void reset()  
      long skip​(long count)  
      void skipToPos​(long expectedOffset, java.lang.String error)  
      java.lang.String toString()  
      • Methods inherited from class java.io.InputStream

        available, close, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • STRING_CHARSET_UTF16

        protected static final java.nio.charset.Charset STRING_CHARSET_UTF16
      • STRING_CHARSET_UTF8

        protected static final java.nio.charset.Charset STRING_CHARSET_UTF8
    • Constructor Detail

      • ParserStream

        public ParserStream​(@NotNull
                            @NotNull java.io.InputStream inputStream)
    • Method Detail

      • getPos

        public long getPos()
      • readInt8

        public int readInt8()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • readInt16

        public int readInt16()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • readInt32

        public int readInt32()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • readUInt32

        public long readUInt32()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • readString16Fixed

        public java.lang.String readString16Fixed​(int len)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readInt32Array

        public int[] readInt32Array​(int count)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • readInt8Array

        public byte[] readInt8Array​(int count)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • skip

        public long skip​(long count)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
      • checkInt8

        public void checkInt8​(int expected,
                              java.lang.String error)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • checkInt16

        public void checkInt16​(int expected,
                               java.lang.String error)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • checkPos

        public void checkPos​(long expectedOffset,
                             java.lang.String error)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • skipToPos

        public void skipToPos​(long expectedOffset,
                              java.lang.String error)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • mark

        public void mark​(int len)
        Overrides:
        mark in class java.io.InputStream
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • readFully

        public void readFully​(byte[] b)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readFully

        public void readFully​(byte[] b,
                              int off,
                              int len)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(@NotNull
                        @org.jetbrains.annotations.NotNull byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object