Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] Clarify thread safety of Decoders returned by DecoderFactory. #3278

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@

/**
* A factory for creating and configuring {@link Decoder}s.
* <p/>
* <p>
* Factories are thread-safe, and are generally cached by applications for
* performance reasons. Multiple instances are only required if multiple
* concurrent configurations are needed.
* </p>
* <p>
* Although Factories are thread-safe the {@link Decoder}s they return are not.
* </p>
*
* @see Decoder
*/
Expand Down Expand Up @@ -70,7 +74,7 @@ public static DecoderFactory get() {
* nearest value in the range. Values less than 512 or greater than
* 1024*1024 are not recommended.
* @return This factory, to enable method chaining:
*
*
* <pre>
* DecoderFactory myFactory = new DecoderFactory().useBinaryDecoderBufferSize(4096);
* </pre>
Expand All @@ -87,7 +91,7 @@ public DecoderFactory configureDecoderBufferSize(int size) {
/**
* Returns this factory's configured preferred buffer size. Used when creating
* Decoder instances that buffer. See {@link #configureDecoderBufferSize}
*
*
* @return The preferred buffer size, in bytes.
*/
public int getConfiguredBufferSize() {
Expand Down Expand Up @@ -156,7 +160,7 @@ public BinaryDecoder binaryDecoder(InputStream in, BinaryDecoder reuse) {
* In the case that the improved performance of a buffering implementation does
* not outweigh the inconvenience of its buffering semantics, a "direct" decoder
* can be used.
*
*
* @param in The InputStream to initialize to
* @param reuse The BinaryDecoder to <i>attempt</i> to reuse given the factory
* configuration. A BinaryDecoder implementation may not be
Expand Down Expand Up @@ -227,11 +231,11 @@ public BinaryDecoder createBinaryDecoder(byte[] bytes, BinaryDecoder reuse) {

/**
* This method is shorthand for
*
*
* <pre>
* createBinaryDecoder(bytes, 0, bytes.length, reuse);
* </pre>
*
*
* {@link #binaryDecoder(byte[], int, int, BinaryDecoder)}
*/
public BinaryDecoder binaryDecoder(byte[] bytes, BinaryDecoder reuse) {
Expand Down
Loading