Package java.io

Examples of java.io.RandomAccessFile.writeLong()


     * @tests java.io.RandomAccessFile#writeLong(long)
     */
    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here


     * @tests java.io.RandomAccessFile#writeLong(long)
     */
    public void test_writeLongJ() throws IOException {
        // Test for method void java.io.RandomAccessFile.writeLong(long)
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here

     * @tests java.io.RandomAccessFile#readLong()
     */
    public void test_readLong() throws IOException {
        // Test for method long java.io.RandomAccessFile.readLong()
        RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
        raf.writeLong(Long.MAX_VALUE);
        raf.seek(0);
        assertEquals("Incorrect long read/written", Long.MAX_VALUE, raf
                .readLong());
        raf.close();
    }
View Full Code Here

  if (parent.useFileChannel) {
      RandomAccessFile raf = parent.getRAF(mid);

      parent.markWriting(raf);

      raf.writeLong(packetSize);
      msg.writePacket(raf.getChannel(), false);

      long endofdata = raf.getFilePointer();

      if (bbuf != null) {
View Full Code Here

      msg.writePacket(raf.getChannel(), false);

      long endofdata = raf.getFilePointer();

      if (bbuf != null) {
    raf.writeLong(bbuf.remaining()); // length of attachment
    raf.getChannel().write(bbuf);
      } else {
    raf.writeLong(0);
      }
      long endoffile = raf.getFilePointer();
View Full Code Here

      if (bbuf != null) {
    raf.writeLong(bbuf.remaining()); // length of attachment
    raf.getChannel().write(bbuf);
      } else {
    raf.writeLong(0);
      }
      long endoffile = raf.getFilePointer();

      parent.markGood(raf);
View Full Code Here

      harness.check(s, "foobar", "writeChar/writeChars/readChar()");

      // writeLong/readLong
      raf.seek(0);
      raf.writeLong(123456L);
      raf.seek(0);
      harness.check(raf.readLong(), 123456L, "writeLong(l)/readLong()");

      // writeFloat/readFloat
      raf.seek(0);
View Full Code Here

                break;
            case LoadCorrupt:
                // loadable but invalid metadata
                // location of order index low priority index for first destination...
                raf.seek(8*1024 + 57);
                raf.writeLong(Integer.MAX_VALUE-10);
                break;
            default:
        }
        raf.close();

View Full Code Here

                // this will be the first item in the queue, set the head to indicate we have data now
                writeHead(raf, new_entry_pos);
            } else {
                // update the previous entry's next pointer
                raf.seek(m_tail);
                raf.writeLong(new_entry_pos - m_tail - m_longSize);
            }

            // go to the new entry's position and write its next pointer and the data
            raf.seek(new_entry_pos);
            raf.writeLong(-1L); // sets the next pointer to indicate this is the last entry
View Full Code Here

                raf.writeLong(new_entry_pos - m_tail - m_longSize);
            }

            // go to the new entry's position and write its next pointer and the data
            raf.seek(new_entry_pos);
            raf.writeLong(-1L); // sets the next pointer to indicate this is the last entry
            raf.write(bytes);

            // finally, update the tail
            writeTail(raf, new_entry_pos);
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.