Examples of readFully()


Examples of java.io.RandomAccessFile.readFully()

        if (sizeAfter <= sizeBefore) return;

        RandomAccessFile raf = new RandomAccessFile(logFile, "r");
        raf.seek(sizeBefore);
        byte[] b = new byte[(int) (sizeAfter - sizeBefore)];
        raf.readFully(b);
        raf.close();
       
        // import the thread dump;
        importText(new ByteArrayInputStream(b));
    }
View Full Code Here

Examples of java.io.RandomAccessFile.readFully()

    public byte[] getBytes() throws Exception{
        URL uri = getClass().getResource(fileName);
        RandomAccessFile raf = new RandomAccessFile(uri.getFile(),"r");
        byte[] bytes = new byte[(int)raf.length()];
        raf.readFully(bytes);
        return bytes;
    }
}
View Full Code Here

Examples of javax.imageio.stream.FileImageInputStream.readFully()

                // Checking Magic Number
                fis = new FileImageInputStream(input);
                byte[] b = new byte[4];
                fis.mark();
                fis.readFully(b);
                fis.reset();
                boolean cdfCheck = (b[0] == (byte)0x43 && b[1] == (byte)0x44 && b[2] == (byte)0x46);
                boolean hdf5Check = (b[0] == (byte)0x89 && b[1] == (byte)0x48 && b[2] == (byte)0x44);
                boolean gribCheck = (b[0] == (byte)0x47 && b[1] == (byte)0x52 && b[2] == (byte)0x49 && b[3] == (byte)0x42);
View Full Code Here

Examples of javax.imageio.stream.ImageInputStream.readFully()

                    in.mark();
                    try {
                        reclen = jpeg.readSegmentLength();
                        // Check for ICC profile
                        byte[] iccString = new byte[11];
                        in.readFully(iccString);
                        in.skipBytes(1); //string terminator (null byte)

                        if ("ICC_PROFILE".equals(new String(iccString, "US-ASCII"))) {
                            in.skipBytes(2); //chunk sequence number and total number of chunks
                            int payloadSize = reclen - 2 - 12 - 2;
View Full Code Here

Examples of javax.imageio.stream.ImageInputStreamImplTest.BasicImageInputStreamImpl.readFully()

    final BasicImageOutputStreamImpl out = new BasicImageOutputStreamImpl(
        2 * buff.length);
    final ImageInputStream in = new BasicImageInputStreamImpl(out.buff);

    out.writeChars("test");
    in.readFully(buff, 0, 4);
    assertEquals("test", new String(buff));

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageInputStream.readFully()

        bs = new ByteArrayInputStream(b);
        i = new MemoryCacheImageInputStream(bs);

        byte[] fullB = new byte[26];
        i.seek(0);
        i.readFully(fullB);
        h.check(Arrays.equals(fullB,
                              new byte[]
            {
              (byte) 0x92, (byte) 0x80, (byte) 0x05, (byte) 0x77,
              (byte) 0xac, (byte) 0xf2, (byte) 0x8b, (byte) 0xa7,
View Full Code Here

Examples of nom.tam.util.BufferedDataInputStream.readFully()

            byte[] vertexValues = new byte[vertexIds.length * sizeOf];
            for(int i=0; i<vertexIds.length; i++) {
                int vid = in.readInt();
                int transVid = finalIdTranslate.forward(preIdTranslate.backward(vid));
                vertexIds[i] = transVid;
                in.readFully(vertexValueTemplate);
                int valueIdx = i * sizeOf;
                System.arraycopy(vertexValueTemplate, 0, vertexValues, valueIdx, sizeOf);
            }

            /* Sort */
 
View Full Code Here

Examples of one.nio.net.Socket.readFully()

                sendRequest(socket, buffer);
            }

            int responseSize = RpcPacket.getSize(buffer, socket);
            if (responseSize > 4) buffer = new byte[responseSize];
            socket.readFully(buffer, 0, responseSize);

            returnObject(socket);
            return buffer;
        } catch (Exception e) {
            invalidateObject(socket);
View Full Code Here

Examples of org.apache.accumulo.core.file.rfile.bcfile.BCFile.Reader.BlockReader.readFully()

         * Try to fully read block for meta data if error try to close file
         *
         */
        try {
          b = new byte[(int) _currBlock.getRawSize()];
          _currBlock.readFully(b);
        } catch (IOException e) {
          log.debug("Error full blockRead for MetaBlock for file " + fileName + " for block name " + blockName, e);
          throw e;
        } finally {
          _currBlock.close();
View Full Code Here

Examples of org.apache.cassandra.io.BufferedRandomAccessFile.readFully()

                long claimedCRC32;
                byte[] bytes;
                try
                {
                    bytes = new byte[(int) reader.readLong()]; // readlong can throw EOFException too
                    reader.readFully(bytes);
                    claimedCRC32 = reader.readLong();
                }
                catch (EOFException e)
                {
                    // last CL entry didn't get completely written.  that's ok.
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.