IN
- The type of the elements that are being written by the sink.@PublicEvolving public class SimpleStringEncoder<IN> extends Object implements Encoder<IN>
Encoder
that uses toString()
on the input elements and writes them to
the output bucket file separated by newline.构造器和说明 |
---|
SimpleStringEncoder()
Creates a new
StringWriter that uses "UTF-8" charset to convert strings to
bytes. |
SimpleStringEncoder(String charsetName)
Creates a new
StringWriter that uses the given charset to convert strings to bytes. |
public SimpleStringEncoder()
StringWriter
that uses "UTF-8"
charset to convert strings to
bytes.public SimpleStringEncoder(String charsetName)
StringWriter
that uses the given charset to convert strings to bytes.charsetName
- Name of the charset to be used, must be valid input for Charset.forName(charsetName)
public void encode(IN element, OutputStream stream) throws IOException
Encoder
encode
在接口中 Encoder<IN>
element
- the element to be written.stream
- the stream to write the element to.IOException
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.