Examples of readByte()


Examples of org.apache.jute.BinaryInputArchive.readByte()

      } else
      {
        System.out.println(formatTransaction(hdr, txn));
      }

      if (logStream.readByte("EOR") != 'B')
      {
        LOG.error("Last transaction was partial.");
        throw new EOFException("Last transaction was partial.");
      }
      count++;
View Full Code Here

Examples of org.apache.jute_voltpatches.BinaryInputArchive.readByte()

                    + " cxid 0x"
                    + Long.toHexString(hdr.getCxid())
                    + " zxid 0x"
                    + Long.toHexString(hdr.getZxid())
                    + " " + TraceFormatter.op2String(hdr.getType()));
            if (logStream.readByte("EOR") != 'B') {
                LOG.error("Last transaction was partial.");
                throw new EOFException("Last transaction was partial.");
            }
            count++;
        }
View Full Code Here

Examples of org.apache.kahadb.util.DataByteArrayInputStream.readByte()

     * @throws IOException
     */
    public JournalCommand<?> load(Location location) throws IOException {
        ByteSequence data = journal.read(location);
        DataByteArrayInputStream is = new DataByteArrayInputStream(data);
        byte readByte = is.readByte();
        KahaEntryType type = KahaEntryType.valueOf(readByte);
        if( type == null ) {
            throw new IOException("Could not load journal record. Invalid location: "+location);
        }
        JournalCommand<?> message = (JournalCommand<?>)type.createMessage();
View Full Code Here

Examples of org.apache.kato.common.IDataProvider.readByte()

        long l = getProvider().getCurrentLocation();

        IDataProvider p = getProvider();
        if (p.dataRemaining() < 1)
          return null;
        short tag = p.readByte();
        int size = getRecordSize(tag);
        byte[] data = null;
        if (size >= 0) {
          data = getProvider().readBytes(size);
        }
View Full Code Here

Examples of org.apache.kato.common.SubsetDataProvider.readByte()

   
  }
  public void testGetDataAt00() throws IOException {
   
    SubsetDataProvider provider=new SubsetDataProvider(new MockDataProvider(),10);
    short b=provider.readByte();
    assertEquals(0,b);
   
  }
  public void testGetDataAt01() throws IOException {
   
View Full Code Here

Examples of org.apache.lucene.store.ChecksumIndexInput.readByte()

      }

      if (format <= FORMAT_USER_DATA) {
        if (format <= FORMAT_DIAGNOSTICS) {
          userData = input.readStringStringMap();
        } else if (0 != input.readByte()) {
          userData = Collections.singletonMap("userData", input.readString());
        } else {
          userData = Collections.<String,String>emptyMap();
        }
      } else {
View Full Code Here

Examples of org.apache.lucene.store.DataInput.readByte()

  @Override
  public boolean load(InputStream input) throws IOException {
    DataInput in = new InputStreamDataInput(input);
    CodecUtil.checkHeader(in, CODEC_NAME, VERSION_START, VERSION_START);
    byte separatorOrig = in.readByte();
    if (separatorOrig != separator) {
      throw new IllegalStateException("separator=" + separator + " is incorrect: original model was built with separator=" + separatorOrig);
    }
    int gramsOrig = in.readVInt();
    if (gramsOrig != grams) {
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.readByte()

                    throw new Exception("length incorrect");

                for (int j = 0; j < length; j++) {
                    byte b = (byte) (gen.nextInt() & 0x7F);

                    if (file.readByte() != b)
                        throw new Exception("contents incorrect");
                }

                file.close();
            }
View Full Code Here

Examples of org.apache.lucene.store.IndexOutput.readByte()

                    throw new Exception("length incorrect");

                for (int j = 0; j < length; j++) {
                    byte b = (byte) (gen.nextInt() & 0x7F);

                    if (file.readByte() != b)
                        throw new Exception("contents incorrect");
                }

                file.close();
            }
View Full Code Here

Examples of org.apache.lucene.store.InputStream.readByte()

        os.close();

        InputStream in = fsdir.openFile(file);

        // This read primes the buffer in InputStream
        byte b = in.readByte();

        // Close the file
        in.close();

        // ERROR: this call should fail, but succeeds because the buffer
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.