|Enum Constant and Description|
Set this flag to greedily drain the input stream wrapped in
A dummy flag to make it explicit that the particular use case prevents you from setting
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final RemoteInputStream.Flag GREEDY
RemoteInputStreamand send data to the other side.
RemoteInputStreamis normally unbuffered, in the sense that it will never attempt to read ahead and only read bytes that are explicitly requested via
InputStream.read(byte, int, int)methods (and other overloads.)
This is sometimes important, for example if you are going to pass InputStream to the other side, read specific amount of bytes from the other side, then come back to this side and keep reading.
But inability to read ahead means every
RemoteInputStream.read(byte, int, int) call incurs
a remote roundtrip. A local buffering via
BufferedInputStream would help,
but you'd still block on a roundtrip whenever a buffer goes empty.
When this flag is set, it changes the underlying data transfer model of
RemoteInputStream from pull to push. The side that created
will launch a thread and start proactively sending data to the other side.
The side that received
RemoteInputStream will buffer this content,
and so now
RemoteInputStream.read(byte, int, int) will only block
when there's no data. In this way, it hides the network latency completely
when you send a large amount of data.
When communicating with earlier version of the remoting library on the other side, the channel falls back and behaves as if this flag was not specified.
public static final RemoteInputStream.Flag NOT_GREEDY
public static final RemoteInputStream.Flag MANUAL_UNEXPORT
public static RemoteInputStream.Flag values()
for (RemoteInputStream.Flag c : RemoteInputStream.Flag.values()) System.out.println(c);
public static RemoteInputStream.Flag valueOf(String name)
Copyright © 2004–2021. All rights reserved.