Package java.io

Examples of java.io.RandomAccessFile.writeByte()


            /* Output Label */
            raf.write(ZoneInfoFile.JAVAZM_LABEL, 0,
                      ZoneInfoFile.JAVAZM_LABEL.length);

            /* Output Version */
            raf.writeByte(ZoneInfoFile.JAVAZM_VERSION);

            index = ZoneInfoFile.JAVAZM_LABEL.length + 2;

            /* Output Version of Olson's tzdata */
            byte[] b = Main.getVersionName().getBytes("UTF-8");
View Full Code Here


            index = ZoneInfoFile.JAVAZM_LABEL.length + 2;

            /* Output Version of Olson's tzdata */
            byte[] b = Main.getVersionName().getBytes("UTF-8");
            raf.writeByte(ZoneInfoFile.TAG_TZDataVersion);
            raf.writeShort((b.length+1) & 0xFFFF);
            raf.write(b);
            raf.writeByte(0x00);
            index += b.length + 4;

View Full Code Here

            /* Output Version of Olson's tzdata */
            byte[] b = Main.getVersionName().getBytes("UTF-8");
            raf.writeByte(ZoneInfoFile.TAG_TZDataVersion);
            raf.writeShort((b.length+1) & 0xFFFF);
            raf.write(b);
            raf.writeByte(0x00);
            index += b.length + 4;

            /* Output ID list. */
            raf.writeByte(ZoneInfoFile.TAG_ZoneIDs);
            block_size = 2;
View Full Code Here

            raf.write(b);
            raf.writeByte(0x00);
            index += b.length + 4;

            /* Output ID list. */
            raf.writeByte(ZoneInfoFile.TAG_ZoneIDs);
            block_size = 2;
            raf.writeShort(block_size & 0xFFFF);
            short nID = 0;
            raf.writeShort(nID & 0xFFFF);
            for (int i = 0; i < roi_size; i++) {
View Full Code Here

            short nID = 0;
            raf.writeShort(nID & 0xFFFF);
            for (int i = 0; i < roi_size; i++) {
                for (String key : roit.get(i)) {
                    byte size = (byte)key.getBytes("UTF-8").length;
                    raf.writeByte(size & 0xFF);
                    raf.write(key.getBytes("UTF-8"), 0, size);
                    block_size += 1 + size;
                    nID++;
                }
            }
View Full Code Here

            raf.writeShort((block_size) & 0xFFFF);
            raf.writeShort(nID & 0xFFFF);
            raf.seek(fp);

            /* Output sorted rawOffset list. */
            raf.writeByte(ZoneInfoFile.TAG_RawOffsets);
            index += 3 + block_size;
            block_size = roi_size * 4;
            raf.writeShort(block_size & 0xFFFF);
            for (int i = 0; i < roi_size; i++) {
                raf.writeInt(Integer.parseInt(roi.get(i).toString()));
View Full Code Here

            for (int i = 0; i < roi_size; i++) {
                raf.writeInt(Integer.parseInt(roi.get(i).toString()));
            }

            /* Output sorted rawOffsetIndex list. */
            raf.writeByte(ZoneInfoFile.TAG_RawOffsetIndices);
            index += 3 + block_size;
            block_size = 0;
            raf.writeShort(block_size & 0xFFFF);
            int num;
            for (int i = 0; i < roi_size; i++) {
View Full Code Here

            int num;
            for (int i = 0; i < roi_size; i++) {
                num = roit.get(i).size();
                block_size += num;
                for (int j = 0; j < num; j++) {
                    raf.writeByte(i);
                }
            }
            fp = raf.getFilePointer();
            raf.seek(index);
            raf.writeShort((block_size) & 0xFFFF);
View Full Code Here

                Main.panic("Data not exist. (aliases)");
                return 0;
            }

            /* Output ID list. */
            raf.writeByte(ZoneInfoFile.TAG_ZoneAliases);
            index += 3 + block_size;
            block_size = 2;
            raf.writeShort(block_size & 0xFFFF);
            raf.writeShort(a.size() & 0xFFFF);
            for (String key : a.keySet()) {
View Full Code Here

            raf.writeShort(a.size() & 0xFFFF);
            for (String key : a.keySet()) {
                String alias = a.get(key);
                byte key_size = (byte)key.length();
                byte alias_size = (byte)alias.length();
                raf.writeByte(key_size & 0xFF);
                raf.write(key.getBytes("UTF-8"), 0, key_size);
                raf.writeByte(alias_size & 0xFF);
                raf.write(alias.getBytes("UTF-8"), 0, alias_size);
                block_size += 2 + key_size + alias_size;
            }
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.