Examples of writeBytes()


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

    OutputStream os = new FileOutputStream(filename);
    try {
      os = new BufferedOutputStream(os);
      final DataOutput out = new OutputStreamDataOutput(os);
      CodecUtil.writeHeader(out, CharacterDefinition.HEADER, CharacterDefinition.VERSION);
      out.writeBytes(characterCategoryMap, 0, characterCategoryMap.length);
      for (int i = 0; i < CharacterDefinition.CLASS_COUNT; i++) {
        final byte b = (byte) (
          (invokeMap[i] ? 0x01 : 0x00) |
          (groupMap[i] ? 0x02 : 0x00)
        );
View Full Code Here

Examples of org.apache.lucene.store.RAMOutputStream.writeBytes()

                  }
                  if (hasPayloads) {
                    final BytesRef payload = docsAndPositionsEnum.getPayload();
                    if (payload != null) {
                      scratch.add(payload.length);
                      ros.writeBytes(payload.bytes, payload.offset, payload.length);
                    } else {
                      scratch.add(0);
                    }
                  }
                }
View Full Code Here

Examples of org.apache.lucene.util.PagedBytes.PagedBytesDataOutput.writeBytes()

    Random r2 = new Random(seed);
    while(netBytes < 1.1*Integer.MAX_VALUE) {
      int numBytes = _TestUtil.nextInt(r2, 1, 100000);
      byte[] bytes = new byte[numBytes];
      r2.nextBytes(bytes);
      dataOutput.writeBytes(bytes, bytes.length);
      long fp = dataOutput.getPosition();
      assert fp == lastFP + numBytes;
      lastFP = fp;
      netBytes += numBytes;
    }
View Full Code Here

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

      new NFSDataOutputStream(fs.create(file, true));

    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 {
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.Ptg.writeBytes()

        int pos = offset;

        for (int k = 0; k < field_13_name_definition.size(); k++) {
            Ptg ptg = ( Ptg ) field_13_name_definition.get(k);

            ptg.writeBytes(data, pos);
            pos += ptg.getSize();
        }
    }

View Full Code Here

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

    public void testWriteBytes() throws Exception
    {
        JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
        byte[] bytes = {1,2,3,4};
        bm.writeBytes(bytes, 1, 2);
        bm.reset();
        bytes = new byte[2];
        bm.readBytes(bytes);
        assertEquals(2, bytes[0]);
        assertEquals(3, bytes[1]);
View Full Code Here

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

    public void testWriteBytes() throws Exception
    {
        JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
        byte[] bytes = {1,2,3,4};
        bm.writeBytes(bytes, 1, 2);
        bm.reset();
        bytes = new byte[2];
        bm.readBytes(bytes);
        assertEquals(2, bytes[0]);
        assertEquals(3, bytes[1]);
View Full Code Here

Examples of org.chromium.sdk.internal.websocket.ManualLoggingSocketWrapper.LoggableOutput.writeBytes()

        output.writeByte((byte) ((length >> 8) & 0xFF));
        output.writeByte((byte) (length & 0xFF));
      }

      if (maskBytes != null) {
        output.writeBytes(maskBytes);
      }
      loggablePayload.send(output, maskBytes);

      if (isClosingMessage) {
        setOutputClosed(true);
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQBytesMessage.writeBytes()

    }
   
    private void writeBuffer(byte[] buf,int offset, int length) throws IOException{
        try {
        BytesMessage message = new ActiveMQBytesMessage();
        message.writeBytes(buf,offset,length);
        producer.send(message);
        }catch(JMSException jmsEx){
            IOException ioEx = new IOException(jmsEx.getMessage());
            throw ioEx;
        }
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQStreamMessage.writeBytes()

    try {
      byte[] test = new byte[50];
      for(int i =0; i< test.length;i++){
        test[i]=(byte)i;
      }
      msg.writeBytes(test);
      msg.reset();
      byte[] valid = new byte[test.length];
      msg.readBytes(valid);
      for(int i = 0; i < valid.length;i++){
        assertTrue(valid[i]==test[i]);
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.