Examples of readFully()


Examples of org.h2.store.DataReader.readFully()

                    in.readFully(data, 0, pageSize);
                } else if (size == 1) {
                    // empty
                } else {
                    byte[] compressBuffer = new byte[size];
                    in.readFully(compressBuffer, 0, size);
                    try {
                        compress.expand(compressBuffer, 0, size, data, 0, pageSize);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        throw DbException.convertToIOException(e);
                    }
View Full Code Here

Examples of org.h2.store.FileStore.readFully()

                        file.readFully(buffFile, off, l);
                    } catch (Exception e) {
                        a = e;
                    }
                    try {
                        mem.readFully(buffMem, off, l);
                    } catch (Exception e) {
                        b = e;
                    }
                    if (a != b) {
                        if (a == null || b == null) {
View Full Code Here

Examples of org.h2.store.fs.FileObject.readFully()

        assertEquals(10000, fo.length());
        fo.close();
        assertEquals(10000, fs.length(fsBase + "/test"));
        fo = fs.openFileObject(fsBase + "/test", "r");
        byte[] test = new byte[10000];
        fo.readFully(test, 0, 10000);
        assertEquals(buffer, test);
        assertThrows(IOException.class, fo).write(test, 0, 10);
        assertThrows(IOException.class, fo).setFileLength(10);
        fo.close();
        long lastMod = fs.getLastModified(fsBase + "/test");
View Full Code Here

Examples of org.h2.store.fs.FileObject.readFully()

                    len = (int) Math.min(len, ra.length() - ra.getFilePointer());
                    byte[] b1 = new byte[len];
                    byte[] b2 = new byte[len];
                    trace("readFully " + len);
                    ra.readFully(b1, 0, len);
                    f.readFully(b2, 0, len);
                    buff.append("readFully " + len + "\n");
                    assertEquals(b1, b2);
                    break;
                }
                case 4: {
View Full Code Here

Examples of org.h2.store.fs.FileObject.readFully()

        stat.execute("create table test(id int, name varchar) as select 1, 'Hello World1'");
        conn.close();
        FileObject f = FileSystem.getInstance(getBaseDir()).openFileObject(getBaseDir() + "/recovery.h2.db", "rw");
        byte[] buff = new byte[Constants.DEFAULT_PAGE_SIZE];
        while (f.getFilePointer() < f.length()) {
            f.readFully(buff, 0, buff.length);
            if (new String(buff).indexOf("Hello World1") >= 0) {
                buff[buff.length - 1]++;
                f.seek(f.getFilePointer() - buff.length);
                f.write(buff, 0, buff.length);
            }
View Full Code Here

Examples of org.jboss.as.protocol.ByteDataInput.readFully()

                expectHeader(input, DomainControllerProtocol.PARAM_HOST_ID);
                hostId = input.readUTF();
                expectHeader(input, DomainControllerProtocol.PARAM_HOST_CONTROLLER_HOST);
                final int addressSize = input.readInt();
                byte[] addressBytes = new byte[addressSize];
                input.readFully(addressBytes);
                expectHeader(input, DomainControllerProtocol.PARAM_HOST_CONTROLLER_PORT);
                slavePort = input.readInt();
                slaveAddress = InetAddress.getByAddress(addressBytes);
                input.close();
            } finally {
View Full Code Here

Examples of org.jgroups.util.ByteArrayDataInputStream.readFully()

        assert read == 4;
        assert in.position() == 4;

        in.position(0);
        try {
            in.readFully(buf, 0, buf.length);
            assert false : "readFully() should have thrown an EOFException";
        }
        catch(Exception eof_ex) {
            System.out.println("got exception as expected: " + eof_ex);
            assert eof_ex instanceof EOFException;
View Full Code Here

Examples of org.voltdb.messaging.FastDeserializer.readFully()

                } else {
                    m_hasVersion2FormatChunks = false;
                }
                int numJSONBytes = fd.readInt();
                byte jsonBytes[] = new byte[numJSONBytes];
                fd.readFully(jsonBytes);
                String jsonString = new String(jsonBytes, "UTF-8");
                JSONObject obj = new JSONObject(jsonString);

                m_txnId = obj.getLong("txnId");
                //Timestamp field added for 3.0, might not be there
View Full Code Here

Examples of ucar.unidata.io.RandomAccessFile.readFully()

            out = new RandomAccessFile(toPath, "rw");
            in = new RandomAccessFile(fromPath.trim(), "r");

            out.seek(0);
            byte[] cs = new byte[(int) in.length()];
            in.readFully(cs);
            out.write(cs);
          } finally {
            if (out != null)
              try {
                out.close();
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.