Package java.io

Examples of java.io.RandomAccessFile.skipBytes()


                {

                    try
                    {
                        buffer.append(raf.readByte());
                        raf.skipBytes(space);
                    }
                    catch (EOFException e)
                    {
                        i = size;
                    }
View Full Code Here


        xml_os.close();
      }
    }
    RandomAccessFile raf = new RandomAccessFile(filename, "rw");
    try {
      raf.skipBytes(7);
      // int return_val =
      updateElement(raf, handler.countList, 0);
      // Debug.p("Return val: " + return_val);
    } finally {
      raf.close();
View Full Code Here

            try {
                RandomAccessFile tmp = new RandomAccessFile( filename, "r" );
                String line;
                int maxLength = 10000;
                if( tmp.length() > maxLength ) {
                    tmp.skipBytes( (int)tmp.length() - maxLength );
                    tmp.readLine();
                }
               
                while ( (line = tmp.readLine()) != null )
                    textString = textString + line;
View Full Code Here

            // $$kk: 10.22.99: jan: please either implement this or throw an exception!
            // $$fb: 2001-07-13: done. Fixes Bug 4479981
            RandomAccessFile raf=new RandomAccessFile(out, "rw");
            if (raf.length()<=0x7FFFFFFFl) {
                                // skip AU magic and data offset field
                raf.skipBytes(8);
                raf.writeInt(bytesWritten-AuFileFormat.AU_HEADERSIZE);
                                // that's all
            }
            raf.close();
        }
View Full Code Here

                            0, 8,
                            // method
                            0, 0
                        }, header);
                    // ignore timestamp
                    a.skipBytes(4);
                    rest = new byte[17];
                    a.readFully(rest);
                    assertArrayEquals(new byte[] {
                            // CRC
                            (byte) 0x50, (byte) 0x6F, (byte) 0x31, (byte) 0x5c,
View Full Code Here

                            8, 8,
                            // method
                            8, 0,
                        }, header);
                    // ignore timestamp
                    a.skipBytes(4);
                    byte[] rest = new byte[31];
                    a.readFully(rest);
                    assertArrayEquals(new byte[] {
                            // CRC
                            (byte) 0x50, (byte) 0x6F, (byte) 0x31, (byte) 0x5c,
View Full Code Here

                            8, 8,
                            // method
                            8, 0,
                        }, header);
                    // ignore timestamp
                    a.skipBytes(4);
                    rest = new byte[17];
                    a.readFully(rest);
                    assertArrayEquals(new byte[] {
                            // CRC
                            0, 0, 0, 0,
View Full Code Here

                            0, 8,
                            // method
                            8, 0,
                        }, header);
                    // ignore timestamp
                    a.skipBytes(4);
                    byte[] rest = new byte[31];
                    a.readFully(rest);
                    assertArrayEquals(new byte[] {
                            // CRC
                            (byte) 0x50, (byte) 0x6F, (byte) 0x31, (byte) 0x5c,
View Full Code Here

                            0, 8,
                            // method
                            8, 0,
                        }, header);
                    // ignore timestamp
                    a.skipBytes(4);
                    rest = new byte[17];
                    a.readFully(rest);
                    assertArrayEquals(new byte[] {
                            // CRC
                            (byte) 0x50, (byte) 0x6F, (byte) 0x31, (byte) 0x5c,
View Full Code Here

                            0, 8,
                            // method
                            0, 0
                        }, header);
                    // ignore timestamp
                    a.skipBytes(4);
                    byte[] rest = new byte[31];
                    a.readFully(rest);
                    // 1e6 == 0xF4240
                    assertArrayEquals(new byte[] {
                            // CRC
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.