Examples of writeByte()


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

    byte bits = 0x0;
    if (doVectorPositions)
      bits |= TermVectorsReader.STORE_POSITIONS_WITH_TERMVECTOR;
    if (doVectorOffsets)
      bits |= TermVectorsReader.STORE_OFFSET_WITH_TERMVECTOR;
    tvf.writeByte(bits);

    int encoderUpto = 0;
    int lastTermBytesCount = 0;

    final ByteSliceReader reader = perThread.vectorSliceReader;
View Full Code Here

Examples of org.apache.lucene.store.OutputStream.writeByte()

        int n = fieldInfos.fieldNumber(field.name());
        float norm =
          fieldBoosts[n] * similarity.lengthNorm(field.name(),fieldLengths[n]);
        OutputStream norms = directory.createFile(segment + ".f" + n);
        try {
          norms.writeByte(similarity.encodeNorm(norm));
        } finally {
          norms.close();
        }
      }
    }
View Full Code Here

Examples of org.apache.lucene.store.OutputStreamDataOutput.writeByte()

      final DataOutput out = new OutputStreamDataOutput(os);
      CodecUtil.writeHeader(out, BinaryDictionary.POSDICT_HEADER, BinaryDictionary.VERSION);
      out.writeVInt(posDict.size());
      for (String s : posDict) {
        if (s == null) {
          out.writeByte((byte)0);
          out.writeByte((byte)0);
          out.writeByte((byte)0);
        } else {
          String data[] = CSVUtil.parse(s);
          assert data.length == 3 : "malformed pos/inflection: " + s;
View Full Code Here

Examples of org.apache.nutch.fs.NFSDataOutputStream.writeByte()

    return new RecordWriter() {
        public void write(WritableComparable key, Writable value)
          throws IOException {
          out.writeBytes(key.toString());         // BUG: assume 8-bit chars
          out.writeByte('\t');
          out.writeBytes(value.toString());       // BUG: assume 8-bit chars
          out.writeByte('\n');
        }
        public void close() throws IOException {
          out.close();
View Full Code Here

Examples of org.apache.poi.hssf.record.cont.ContinuableRecordOutput.writeByte()

     */
    private static void confirmSize(int expectedSize, UnicodeString s, int amountUsedInCurrentRecord) {
        ContinuableRecordOutput out = ContinuableRecordOutput.createForCountingOnly();
        out.writeContinue();
        for(int i=amountUsedInCurrentRecord; i>0; i--) {
            out.writeByte(0);
        }
        int size0 = out.getTotalSize();
        s.serialize(out);
        int size1 = out.getTotalSize();
        int actualSize = size1-size0;
View Full Code Here

Examples of org.apache.poi.util.LittleEndianByteArrayOutputStream.writeByte()

        record.serialize(out);
      }
      int expectedEndIx = offset+dataSize;
      // padding
      while (out.getWriteIndex() < expectedEndIx) {
        out.writeByte(0);
      }
    } else {
      out.write(_uninterpretedData);
    }
    return recSize;
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage.writeByte()

     * @throws Exception
     */
    public void testReadBytes() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        bm.writeByte((byte)3);
        bm.writeByte((byte)4);
        bm.reset();
        byte[] result = new byte[2];
        int count = bm.readBytes(result);
        assertEquals((byte)3, result[0]);
View Full Code Here

Examples of org.apache.qpid.client.message.JMSStreamMessage.writeByte()

    public void testEOFByte() throws Exception
    {
        try
        {
            JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
            bm.writeByte((byte)1);
            bm.reset();
            bm.readByte();
            // should throw
            bm.readByte();
            fail("expected exception did not occur");
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.writeByte()

            // message length placeholder
            protocol.writeI32( Integer.MAX_VALUE );
            // message header length placeholder
            protocol.writeI16( Short.MAX_VALUE );
            // version
            protocol.writeByte( VERSION );
            // service name
            protocol.writeString( serviceName );
            // dubbo request id
            protocol.writeI64( request.getId() );
            protocol.getTransport().flush();
View Full Code Here

Examples of org.apache.thrift.protocol.TProtocol.writeByte()

  }
 
  public static void testNakedByte() throws Exception {
    TMemoryBuffer buf = new TMemoryBuffer(0);
    TProtocol proto = factory.getProtocol(buf);
    proto.writeByte((byte)123);
    byte out = proto.readByte();
    if (out != 123) {
      throw new RuntimeException("Byte was supposed to be " + (byte)123 + " but was " + out);
    }
  }
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.