Examples of encode()


Examples of java.nio.charset.CharsetEncoder.encode()

      InputStream stream;

      try {
        byte[] bytes;
        ByteBuffer byteBuffer= encoder.encode(CharBuffer.wrap(document.get()));
        if (byteBuffer.hasArray())
          bytes= byteBuffer.array();
        else {
          bytes= new byte[byteBuffer.limit()];
          byteBuffer.get(bytes);

Examples of javaFlacEncoder.FLAC_FileEncoder.encode()

  private void convert(){
    FLAC_FileEncoder encoder1 = new FLAC_FileEncoder();
    File infile = this.croppedWaveFile;
    File outfile = new File("recording.flac");
    //encoder1.useThreads(false);
    encoder1.encode(infile, outfile);
  }

  /** Very Similary to isSilent, except this method will record until the maxRMS falls below a given threshold*/
  private void autoStop(){

Examples of javax.imageio.ImageWriter.encode()

            PNGEncodeParam param = PNGEncodeParam.getDefaultEncodeParam( bi );

            ImageEncoder encoder = ImageCodec.createImageEncoder( "PNG", out, param ); //NON-NLS
            try {
                // Writes it to a file as a .png
                encoder.encode( bi );
            } catch (IOException e) {
                throw new IllegalStateException("IOException error.", e);
            } catch (NullPointerException npe) {
                throw new IllegalStateException("Could not encode buffered image because it was null.", npe);
            }

Examples of javax.media.jai.tilecodec.TileEncoder.encode()

      ByteArrayOutputStream stream = new ByteArrayOutputStream();
      TileEncoder encoder = tef.createEncoder(stream, tcpl,
                r.getSampleModel());

      try {
    encoder.encode(r);
      } catch (java.io.IOException ioe) {
    throw new RuntimeException(ioe.getMessage());
      }

      return stream.toByteArray();

Examples of jp.ameba.mongo.protocol.MessageHeader.encode()

    MessageHeader header = request.getHeader();
    header.setMessageLength(size);
    // 開始位置まで戻る
    output.setPosition(start);
    // ヘッダ内容を出力
    header.encode(output);
    // 最終位置に戻る
    output.setPosition(end);
  }

  /*
 

Examples of jsky.image.GifEncoder.encode()

            DialogUtil.error(e);
        }

        // Encode the painted image as a GIF, sending to output stream
        GifEncoder encoder = new GifEncoder(newImage, out);
        encoder.encode();

        // Close the output stream
        out.close();
    }

Examples of marauroa.common.net.Encoder.encode()

     * Create the perception and serialize it.
     */
    Perception p=zone.getPerception(obj, Perception.SYNC);
    MessageS2CPerception msg=new MessageS2CPerception(null, p);
    Encoder enc=Encoder.get();
    byte[] data=enc.encode(msg);
   
    Decoder dec=Decoder.get();
    List<Message> msgs=dec.decode(null, data);
   
    /*
 

Examples of muduo.codec.ProtobufEncoder.encode()

        Query query = Query.newBuilder()
                .setId(1)
                .setQuestioner("Chen Shuo")
                .addQuestion("Running?")
                .build();
        ChannelBuffer buf = (ChannelBuffer) encoder.encode(null, null, query);

        ProtobufDecoder decoder = new ProtobufDecoder();
        decoder.addMessageType(Query.getDefaultInstance());
        Message message = (Message) decoder.decode(null, null, buf);
        assertEquals(query, message);

Examples of muduo.rpc.RpcEncoder.encode()

    @Test
    public void testEncoder() throws Exception {
        RpcEncoder encoder = new RpcEncoder();
        RpcMessage message = RpcMessage.newBuilder().setType(MessageType.REQUEST).setId(1).build();
        encoder.encode(null, null, message);
    }

    @Test
    public void testEncoder2() throws Exception {
        RpcEncoder encoder = new RpcEncoder();

Examples of net.hasor.rsf.serialize.Encoder.encode()

    /**设置要返回的值*/
    public void setReturnData(Object data, SerializeFactory serializeFactory) throws Throwable {
        String codeName = this.getSerializeType();
        Encoder encoder = serializeFactory.getEncoder(codeName);
        //
        this.returnData = encoder.encode(data);
    }
}
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.