Module mslinks
Package io

Class ByteReader

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

    public class ByteReader
    extends java.io.InputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean le  
      private int pos  
      private java.io.InputStream stream  
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteReader​(java.io.InputStream in)  
    • Field Detail

      • le

        private boolean le
      • stream

        private java.io.InputStream stream
      • pos

        private int pos
    • Constructor Detail

      • ByteReader

        public ByteReader​(java.io.InputStream in)
    • Method Detail

      • getPosition

        public int getPosition()
      • changeEndiannes

        public ByteReader changeEndiannes()
      • seek

        public boolean seek​(int n)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

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

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

        public long read2bytes()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • read3bytes

        public long read3bytes()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • read4bytes

        public long read4bytes()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • read5bytes

        public long read5bytes()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • read6bytes

        public long read6bytes()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • read7bytes

        public long read7bytes()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • read8bytes

        public long read8bytes()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • readString

        public java.lang.String readString​(int sz)
                                    throws java.io.IOException
        reads 0-terminated string in default code page
        Parameters:
        sz - - maximum size in bytes
        Throws:
        java.io.IOException
      • readUnicodeString

        public java.lang.String readUnicodeString​(int sz)
                                           throws java.io.IOException
        reads 0-terminated string in unicode
        Parameters:
        sz - - maximum size in charcters
        Throws:
        java.io.IOException
      • readUnicodeString

        public java.lang.String readUnicodeString()
                                           throws java.io.IOException
        reads unicode string that has 2 bytes at start indicates length of string
        Throws:
        java.io.IOException