replacement for LimitInputStream

465 views
Skip to first unread message

Ted Yu

unread,
Dec 29, 2013, 11:29:39 AM12/29/13
to guava-discuss
Hi,
Guava deprecated LimitInputStream in v14 and removed it in v15.

What is the replacement in v15 for LimitInputStream ?

Cheers

Luke Sandberg

unread,
Dec 29, 2013, 11:47:30 AM12/29/13
to Ted Yu, guava-discuss

The deprecation notice in guava 14 said.

" Deprecated.
Use ByteStreams.limit(java.io.InputStream, long) instead. This class is scheduled to be removed in Guava release 15.0."

http://docs.guava-libraries.googlecode.com/git-history/5e074af6a526af39a4410a836517e57c72aa50bb/javadoc/com/google/common/io/LimitInputStream.html

Is there some reason that won't work for you?

--
--
guava-...@googlegroups.com
Project site: http://guava-libraries.googlecode.com
This group: http://groups.google.com/group/guava-discuss
 
This list is for general discussion.
To report an issue: http://code.google.com/p/guava-libraries/issues/entry
To get help: http://stackoverflow.com/questions/ask (use the tag "guava")
---
You received this message because you are subscribed to the Google Groups "guava-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guava-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/guava-discuss/CALte62w2%2Bn3xs1hKb2pUH5dGsnO-Nevgo_vvn3f8bb%2B-QNcbdw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Luke Sandberg

unread,
Dec 29, 2013, 12:25:52 PM12/29/13
to Ted Yu, guava-...@googlegroups.com
Then just use LimitInputStream?

Are you trying to make your library compatible with 3 versions of guava?  LimitInputStream has always been a @Beta API and beta apis aren't guaranteed to remain stable over such a long period.

The official notice about this is on the guava homepage: https://code.google.com/p/guava-libraries/#Important_Warnings

"APIs marked with the @Beta annotation at the class or method level are subject to change. They can be modified in any way, or even removed, in any major release. If your code is a library itself (i.e. it is used on the CLASSPATH of users outside your own control), you should not use beta APIs, unless you repackage them (e.g. using ProGuard). Here is a current list of all the beta APIs."

On Sun, Dec 29, 2013 at 9:14 AM, Ted Yu <yuzh...@gmail.com> wrote:
For guava 12.0.1, there is no limit method in ByteStreams.

Cheers

Ted Yu

unread,
Dec 29, 2013, 2:57:46 PM12/29/13
to Luke Sandberg, guava-...@googlegroups.com
One more question:
What's the best practice upgrading from v12 to v14 (v15) ?

Thanks

Jens

unread,
Dec 29, 2013, 3:23:41 PM12/29/13
to guava-...@googlegroups.com, Luke Sandberg
What's the best practice upgrading from v12 to v14 (v15) ?

Create a branch, update Guava, fix errors and/or deprecations, merge branch back to trunk once you are done.

-- J.

Ted Yu

unread,
Dec 31, 2013, 12:45:25 AM12/31/13
to Jens, guava-discuss, Luke Sandberg
Last question, in java/src/main/java/com/google/protobuf/AbstractMessageLite.java of protobuf, I see a slimmed down version of LimitedInputStream :
    static final class LimitedInputStream extends FilterInputStream {

What is the relation between guava's and protobuf's LimitedInputStream ?

Thanks


--
--
guava-...@googlegroups.com
Project site: http://guava-libraries.googlecode.com
This group: http://groups.google.com/group/guava-discuss
 
This list is for general discussion.
To report an issue: http://code.google.com/p/guava-libraries/issues/entry
To get help: http://stackoverflow.com/questions/ask (use the tag "guava")
---
You received this message because you are subscribed to the Google Groups "guava-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guava-discus...@googlegroups.com.

Kevin Bourrillion

unread,
Dec 31, 2013, 2:06:44 PM12/31/13
to Ted Yu, Jens, guava-discuss, Luke Sandberg
I'm apparently less familiar with that code than you are, but what you've cited is clearly a private implementation detail. I'm not sure what kinds of answers you expect to your question or what the significance of them would be.



For more options, visit https://groups.google.com/groups/opt_out.



--
Kevin Bourrillion | Java Librarian | Google, Inc. | kev...@google.com
Reply all
Reply to author
Forward
0 new messages