Package java.io

Examples of java.io.RandomAccessFile.readFully()


                    // grab third entry, verify offset is
                    // 0xFFFFFFFF and it has a ZIP64 extended
                    // information extra field
                    byte[] header = new byte[12];
                    a.readFully(header);
                    assertArrayEquals(new byte[] {
                            // sig
                            (byte) 0x50, (byte) 0x4b, 1, 2,
                            // version made by
                            45, 0,
View Full Code Here


                            0, 0
                        }, header);
                    // ignore timestamp, CRC, compressed size
                    a.skipBytes(12);
                    byte[] rest = new byte[23];
                    a.readFully(rest);
                    assertArrayEquals(new byte[] {
                            // Original Size
                            1, 0, 0, 0,
                            // file name length
                            1, 0,
View Full Code Here

                            (byte) 0xFF, (byte) 0xFF,
                            // file name
                            (byte) '2'
                        }, rest);
                    byte[] extra = new byte[4];
                    a.readFully(extra);
                    assertArrayEquals(new byte[] {
                            // Header-ID
                            1, 0,
                            // size
                            8, 0
View Full Code Here

                            8, 0
                        }, extra);

                    // read offset of LFH
                    byte[] offset = new byte[8];
                    a.readFully(offset);
                    // verify there is a LFH where the CD claims it
                    a.seek(ZipEightByteInteger.getLongValue(offset));
                    byte[] sig = new byte[4];
                    a.readFully(sig);
                    assertArrayEquals(new byte[] {
View Full Code Here

                    byte[] offset = new byte[8];
                    a.readFully(offset);
                    // verify there is a LFH where the CD claims it
                    a.seek(ZipEightByteInteger.getLongValue(offset));
                    byte[] sig = new byte[4];
                    a.readFully(sig);
                    assertArrayEquals(new byte[] {
                            (byte) 0x50, (byte) 0x4b, 3, 4,
                        }, sig);
                } finally {
                    a.close();
View Full Code Here

                    // grab first entry, verify sizes are 0xFFFFFFFF
                    // and it has a ZIP64 extended information extra
                    // field
                    byte[] header = new byte[12];
                    a.readFully(header);
                    assertArrayEquals(new byte[] {
                            // sig
                            (byte) 0x50, (byte) 0x4b, 1, 2,
                            // version made by
                            45, 0,
View Full Code Here

                            0, 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,
                            // Compressed Size
                            (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
View Full Code Here

                            0, 0, 0, 0,
                            // file name
                            (byte) '0'
                        }, rest);
                    byte[] extra = new byte[20];
                    a.readFully(extra);
                    // 5e9 == 0x12A05F200
                    assertArrayEquals(new byte[] {
                            // Header-ID
                            1, 0,
                            // size of extra
View Full Code Here

                        }, extra);

                    // and now validate local file header
                    a.seek(0);
                    header = new byte[10];
                    a.readFully(header);
                    assertArrayEquals(new byte[] {
                            // sig
                            (byte) 0x50, (byte) 0x4b, 3, 4,
                            // version needed to extract
                            45, 0,
View Full Code Here

                            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,
                            // Compressed Size
                            (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
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.