Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Streamable: DataInputStream --> DataInput, DataOutputStream --> DataO…

  • Loading branch information...
commit 89c803eb5cf48bf6ccd14db1df4581e8fe4ad60c 1 parent 8239bbb
@belaban authored
Showing with 355 additions and 383 deletions.
  1. +1 −1  bin/draw.bat
  2. +1 −12 bin/draw.sh
  3. +4 −0 doc/API_Changes.txt
  4. +2 −2 doc/manual/en/modules/advanced.xml
  5. +1 −1  doc/manual/en/modules/api.xml
  6. +2 −2 src/org/jgroups/MergeView.java
  7. +6 −7 src/org/jgroups/Message.java
  8. +2 −2 src/org/jgroups/View.java
  9. +2 −2 src/org/jgroups/ViewId.java
  10. +6 −4 src/org/jgroups/auth/FixedMembershipToken.java
  11. +4 −4 src/org/jgroups/auth/MD5Token.java
  12. +5 −4 src/org/jgroups/auth/RegexMembership.java
  13. +6 −4 src/org/jgroups/auth/SimpleToken.java
  14. +4 −4 src/org/jgroups/auth/X509Token.java
  15. +2 −2 src/org/jgroups/blocks/GridFile.java
  16. +1 −1  src/org/jgroups/blocks/ReplicatedTree.java
  17. +6 −6 src/org/jgroups/blocks/RequestCorrelator.java
  18. +3 −7 src/org/jgroups/blocks/executor/ExecutionService.java
  19. +4 −4 src/org/jgroups/blocks/executor/Executions.java
  20. +4 −4 src/org/jgroups/blocks/locking/Owner.java
  21. +4 −4 src/org/jgroups/blocks/mux/MuxHeader.java
  22. +4 −4 src/org/jgroups/demos/DrawCommand.java
  23. +9 −14 src/org/jgroups/demos/ExecutionServiceDemo.java
  24. +2 −2 src/org/jgroups/protocols/AuthHeader.java
  25. +2 −2 src/org/jgroups/protocols/COMPRESS.java
  26. +4 −4 src/org/jgroups/protocols/DAISYCHAIN.java
  27. +2 −2 src/org/jgroups/protocols/DISCARD.java
  28. +4 −5 src/org/jgroups/protocols/ENCRYPT.java
  29. +5 −10 src/org/jgroups/protocols/Executing.java
  30. +2 −2 src/org/jgroups/protocols/FD.java
  31. +4 −4 src/org/jgroups/protocols/FD_ALL.java
  32. +2 −2 src/org/jgroups/protocols/FD_SIMPLE.java
  33. +2 −2 src/org/jgroups/protocols/FD_SOCK.java
  34. +4 −4 src/org/jgroups/protocols/FcHeader.java
  35. +2 −2 src/org/jgroups/protocols/FragHeader.java
  36. +2 −2 src/org/jgroups/protocols/HTOTAL.java
  37. +6 −6 src/org/jgroups/protocols/Locking.java
  38. +4 −4 src/org/jgroups/protocols/PingData.java
  39. +2 −2 src/org/jgroups/protocols/PingHeader.java
  40. +4 −4 src/org/jgroups/protocols/PrioHeader.java
  41. +6 −6 src/org/jgroups/protocols/RELAY.java
  42. +4 −4 src/org/jgroups/protocols/SCOPE.java
  43. +2 −2 src/org/jgroups/protocols/SEQUENCER.java
  44. +4 −4 src/org/jgroups/protocols/SMACK.java
  45. +3 −6 src/org/jgroups/protocols/STOMP.java
  46. +2 −2 src/org/jgroups/protocols/TpHeader.java
  47. +4 −4 src/org/jgroups/protocols/UNICAST.java
  48. +4 −4 src/org/jgroups/protocols/UNICAST2.java
  49. +2 −2 src/org/jgroups/protocols/VERIFY_SUSPECT.java
  50. +2 −2 src/org/jgroups/protocols/pbcast/FLUSH.java
  51. +2 −2 src/org/jgroups/protocols/pbcast/GMS.java
  52. +4 −4 src/org/jgroups/protocols/pbcast/JoinRsp.java
  53. +2 −2 src/org/jgroups/protocols/pbcast/NakAckHeader.java
  54. +2 −2 src/org/jgroups/protocols/pbcast/STABLE.java
  55. +2 −3 src/org/jgroups/protocols/pbcast/STATE_TRANSFER.java
  56. +2 −2 src/org/jgroups/protocols/pbcast/STREAMING_STATE_TRANSFER.java
  57. +4 −4 src/org/jgroups/stack/GossipData.java
  58. +2 −2 src/org/jgroups/stack/IpAddress.java
  59. +2 −2 src/org/jgroups/util/AdditionalDataUUID.java
  60. +4 −4 src/org/jgroups/util/Digest.java
  61. +4 −4 src/org/jgroups/util/MergeId.java
  62. +2 −2 src/org/jgroups/util/PayloadUUID.java
  63. +2 −2 src/org/jgroups/util/Range.java
  64. +2 −2 src/org/jgroups/util/SingletonAddress.java
  65. +4 −4 src/org/jgroups/util/Streamable.java
  66. +2 −2 src/org/jgroups/util/TopologyUUID.java
  67. +2 −2 src/org/jgroups/util/UUID.java
  68. +100 −100 src/org/jgroups/util/Util.java
  69. +2 −2 tests/junit-functional/org/jgroups/protocols/ENCRYPT14KeystoreTest.java
  70. +2 −2 tests/junit-functional/org/jgroups/protocols/ENCRYPTAsymmetricTest.java
  71. +1 −1  tests/junit-functional/org/jgroups/tests/ConfiguratorTest.java
  72. +1 −1  tests/junit-functional/org/jgroups/tests/CustomProtocolTest.java
  73. +2 −2 tests/junit-functional/org/jgroups/tests/HeadersTest.java
  74. +4 −8 tests/junit-functional/org/jgroups/tests/MessageTest.java
  75. +6 −6 tests/junit/org/jgroups/blocks/ExecutingServiceTest.java
  76. +1 −1  tests/junit/org/jgroups/protocols/GMS_MergeTest.java
  77. +2 −2 tests/junit/org/jgroups/tests/EncryptMessageOrderTestCase.java
  78. +3 −3 tests/junit/org/jgroups/tests/SendAndReceiveTest.java
  79. +1 −1  tests/other/org/jgroups/tests/RpcDispatcherStressTest.java
  80. +5 −6 tests/other/org/jgroups/tests/UnicastTest.java
  81. +6 −6 tests/other/org/jgroups/tests/UnicastTestRpcDist.java
  82. +2 −3 tests/perf/org/jgroups/tests/perf/Data.java
  83. +4 −4 tests/perf/org/jgroups/tests/perf/MemberInfo.java
View
2  bin/draw.bat
@@ -11,7 +11,7 @@ set PROPS=%PROPS%:TCPGOSSIP(initial_hosts=localhost[5556];gossip_refresh_rate=10
set PROPS=%PROPS%:MERGE2(min_interval=5000;max_interval=10000)
set PROPS=%PROPS%:FD_SOCK
set PROPS=%PROPS%:VERIFY_SUSPECT(timeout=1500)
-set PROPS=%PROPS%:pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800)
+set PROPS=%PROPS%:pbcast.NAKACK(retransmit_timeout=600,1200,2400,4800)
set PROPS=%PROPS%:UNICAST(timeout=600,1200,2400,4800)
set PROPS=%PROPS%:pbcast.STABLE(desired_avg_gossip=20000)
set PROPS=%PROPS%:FRAG(frag_size=8096;down_thread=false;up_thread=false)
View
13 bin/draw.sh
@@ -29,17 +29,6 @@ CLASSPATH="$relpath/../classes$SEP$relpath/../conf$SEP"
if [ "$debug" = "true" ]; then
JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=jgc1"
fi
-PROPS="\
-TUNNEL(router_host=localhost;router_port=5556):\
-TCPGOSSIP(initial_hosts=localhost[5556];gossip_refresh_rate=10000;num_initial_members=3;up_thread=true;down_thread=true):\
-MERGE2(min_interval=5000;max_interval=10000):\
-FD_SOCK:\
-VERIFY_SUSPECT(timeout=1500):\
-pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800):\
-UNICAST(timeout=600,1200,2400,4800):\
-pbcast.STABLE(desired_avg_gossip=20000):\
-FRAG(frag_size=8096;down_thread=false;up_thread=false):\
-pbcast.GMS(join_timeout=5000;print_local_addr=true)"
if [ "$cygwin" = "true" ]; then
@@ -47,5 +36,5 @@ if [ "$cygwin" = "true" ]; then
fi
-java -classpath $CLASSPATH $JAVA_OPTS org.jgroups.demos.Draw -props $PROPS $*
+java -classpath $CLASSPATH $JAVA_OPTS org.jgroups.demos.Draw $*
View
4 doc/API_Changes.txt
@@ -34,6 +34,10 @@ API changes in 3.0.0
- Removed deprecated methods and classes
+- Streamable: DataInputStream --> DataInput, DataOutputStream --> DataOutput
+
+
+
View
4 doc/manual/en/modules/advanced.xml
@@ -138,7 +138,7 @@
<FD timeout="10000" max_tries="5" shun="true"/>
<VERIFY_SUSPECT timeout="1500" />
<pbcast.NAKACK
- use_mcast_xmit="false" gc_lag="0"
+ use_mcast_xmit="false"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200,2400,3600"/>
@@ -417,7 +417,7 @@
num_initial_members="3"/>
<VERIFY_SUSPECT timeout="1500" />
<pbcast.NAKACK
- use_mcast_xmit="false" gc_lag="0"
+ use_mcast_xmit="false"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="true"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
View
2  doc/manual/en/modules/api.xml
@@ -575,7 +575,7 @@
<VERIFY_SUSPECT timeout="1500" />
<BARRIER />
<pbcast.NAKACK
- use_mcast_xmit="false" gc_lag="0"
+ use_mcast_xmit="false"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200,2400,3600"/>
View
4 src/org/jgroups/MergeView.java
@@ -97,7 +97,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
super.writeTo(out);
// write subgroups
@@ -114,7 +114,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
super.readFrom(in);
short len=in.readShort();
if(len > 0) {
View
13 src/org/jgroups/Message.java
@@ -10,9 +10,7 @@
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
import java.util.Map;
@@ -527,10 +525,11 @@ public String printObjectHeaders() {
/**
* Streams all members (dest and src addresses, buffer and headers) to the output stream.
+ *
* @param out
* @throws IOException
*/
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
byte leading=0;
if(dest_addr != null)
@@ -623,7 +622,7 @@ public void writeToNoAddrs(Address src, DataOutputStream out) throws IOException
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
// 1. read the leading byte first
byte leading=in.readByte();
@@ -751,14 +750,14 @@ public static String transientFlagsToString(byte flags) {
return sb.toString();
}
- private static void writeHeader(Header hdr, DataOutputStream out) throws IOException {
+ private static void writeHeader(Header hdr, DataOutput out) throws IOException {
short magic_number=ClassConfigurator.getMagicNumber(hdr.getClass());
out.writeShort(magic_number);
hdr.writeTo(out);
}
- private static Header readHeader(DataInputStream in) throws IOException {
+ private static Header readHeader(DataInput in) throws IOException {
try {
short magic_number=in.readShort();
Class clazz=ClassConfigurator.get(magic_number);
View
4 src/org/jgroups/View.java
@@ -182,7 +182,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
// vid
if(vid != null) {
out.writeBoolean(true);
@@ -196,7 +196,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
@SuppressWarnings("unchecked")
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
boolean b;
// vid:
b=in.readBoolean();
View
4 src/org/jgroups/ViewId.java
@@ -124,12 +124,12 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
id=in.readLong();
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeAddress(coord_addr, out);
out.writeLong(id);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
coord_addr=Util.readAddress(in);
id=in.readLong();
}
View
10 src/org/jgroups/auth/FixedMembershipToken.java
@@ -21,8 +21,8 @@
*/
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -122,10 +122,11 @@ public void setMemberList(String list) {
/**
* Required to serialize the object to pass across the wire
*
+ *
* @param out
* @throws java.io.IOException
*/
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken writeTo()");
}
@@ -135,12 +136,13 @@ public void writeTo(DataOutputStream out) throws IOException {
/**
* Required to deserialize the object when read in from the wire
*
+ *
* @param in
* @throws IOException
* @throws IllegalAccessException
* @throws InstantiationException
*/
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken readFrom()");
View
8 src/org/jgroups/auth/MD5Token.java
@@ -1,7 +1,7 @@
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import org.jgroups.Message;
@@ -121,14 +121,14 @@ public boolean authenticate(AuthToken token, Message msg) {
return false;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("MD5Token writeTo()");
}
Util.writeString(this.auth_value, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("MD5Token readFrom()");
View
9 src/org/jgroups/auth/RegexMembership.java
@@ -28,8 +28,8 @@
import org.jgroups.annotations.Property;
import org.jgroups.util.UUID;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -111,16 +111,17 @@ public boolean authenticate(AuthToken token, Message msg) {
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
}
/**
* Required to deserialize the object when read in from the wire
+ *
* @param in
* @throws java.io.IOException
* @throws IllegalAccessException
* @throws InstantiationException
*/
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
}
}
View
10 src/org/jgroups/auth/SimpleToken.java
@@ -1,7 +1,7 @@
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import org.jgroups.Message;
@@ -77,10 +77,11 @@ public boolean authenticate(AuthToken token, Message msg) {
/**
* Required to serialize the object to pass across the wire
*
+ *
* @param out
* @throws IOException
*/
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken writeTo()");
}
@@ -90,12 +91,13 @@ public void writeTo(DataOutputStream out) throws IOException {
/**
* Required to deserialize the object when read in from the wire
*
+ *
* @param in
* @throws IOException
* @throws IllegalAccessException
* @throws InstantiationException
*/
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken readFrom()");
View
8 src/org/jgroups/auth/X509Token.java
@@ -1,7 +1,7 @@
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.KeyStore;
@@ -146,14 +146,14 @@ public boolean authenticate(AuthToken token, Message msg) {
return false;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("X509Token writeTo()");
}
Util.writeByteBuffer(this.encryptedToken, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("X509Token readFrom()");
View
4 src/org/jgroups/blocks/GridFile.java
@@ -365,14 +365,14 @@ public String toString() {
return sb.toString();
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeInt(length);
out.writeLong(modification_time);
out.writeInt(chunk_size);
out.writeByte(flags);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
length=in.readInt();
modification_time=in.readLong();
chunk_size=in.readInt();
View
2  src/org/jgroups/blocks/ReplicatedTree.java
@@ -964,7 +964,7 @@ public static void main(String[] args) {
"FD_SOCK:" +
"VERIFY_SUSPECT(timeout=1500):" +
"pbcast.STABLE(desired_avg_gossip=20000):" +
- "pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800):" +
+ "pbcast.NAKACK(retransmit_timeout=600,1200,2400,4800):" +
"UNICAST(timeout=5000):" +
"FRAG(frag_size=16000;down_thread=false;up_thread=false):" +
"pbcast.GMS(join_timeout=5000;" +
View
12 src/org/jgroups/blocks/RequestCorrelator.java
@@ -10,8 +10,8 @@
import org.jgroups.util.Buffer;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ConcurrentMap;
@@ -596,14 +596,14 @@ public String toString() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
out.writeLong(id);
out.writeBoolean(rsp_expected);
out.writeShort(corrId);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
id=in.readLong();
rsp_expected=in.readBoolean();
@@ -633,12 +633,12 @@ public MultiDestinationHeader(byte type, long id, boolean rsp_expected, short co
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
super.writeTo(out);
Util.writeAddresses(exclusion_list, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
super.readFrom(in);
exclusion_list=Util.readAddresses(in, LinkedList.class);
}
View
10 src/org/jgroups/blocks/executor/ExecutionService.java
@@ -1,10 +1,6 @@
package org.jgroups.blocks.executor;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.io.Serializable;
+import java.io.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -722,7 +718,7 @@ public T call() {
return result;
}
@Override
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
try {
Util.writeObject(task, out);
}
@@ -745,7 +741,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
@SuppressWarnings("unchecked")
@Override
- public void readFrom(DataInputStream in) throws IOException,
+ public void readFrom(DataInput in) throws IOException,
IllegalAccessException, InstantiationException {
// We can't use Util.readObject since it's size is limited to 2^15-1
// The runner could be larger than that possibly
View
8 src/org/jgroups/blocks/executor/Executions.java
@@ -3,8 +3,8 @@
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Constructor;
@@ -129,7 +129,7 @@ public Object call() throws Exception {
}
@Override
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeClass(_classCallable, out);
out.writeByte(_constructorNumber);
out.writeByte(_args.length);
@@ -145,7 +145,7 @@ public void writeTo(DataOutputStream out) throws IOException {
@SuppressWarnings("unchecked")
@Override
- public void readFrom(DataInputStream in) throws IOException,
+ public void readFrom(DataInput in) throws IOException,
IllegalAccessException, InstantiationException {
try {
_classCallable = (Class<? extends Callable<?>>)Util.readClass(in);
View
8 src/org/jgroups/blocks/locking/Owner.java
@@ -5,8 +5,8 @@
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
@@ -35,12 +35,12 @@ public long getThreadId() {
return thread_id;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeAddress(address, out);
out.writeLong(thread_id);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
address=Util.readAddress(in);
thread_id=in.readLong();
}
View
8 src/org/jgroups/blocks/mux/MuxHeader.java
@@ -1,7 +1,7 @@
package org.jgroups.blocks.mux;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import org.jgroups.Global;
@@ -31,11 +31,11 @@ public int size() {
return Global.SHORT_SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeShort(id);
}
- public void readFrom(DataInputStream in) throws IOException {
+ public void readFrom(DataInput in) throws IOException {
id = in.readShort();
}
}
View
8 src/org/jgroups/demos/DrawCommand.java
@@ -3,9 +3,9 @@
import org.jgroups.util.Streamable;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
-import java.io.DataInputStream;
/**
* Encapsulates information about a draw command.
@@ -39,7 +39,7 @@ public DrawCommand() { // needed for streamable
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(mode);
out.writeInt(x);
out.writeInt(y);
@@ -48,7 +48,7 @@ public void writeTo(DataOutputStream out) throws IOException {
out.writeInt(b);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
mode=in.readByte();
x=in.readInt();
y=in.readInt();
View
23 src/org/jgroups/demos/ExecutionServiceDemo.java
@@ -1,7 +1,7 @@
package org.jgroups.demos;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.Arrays;
@@ -122,21 +122,16 @@ public SortingByteCallable(byte[] bytes, int offset, int size) {
// We copy over as a single array with no offset
@Override
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeInt(size);
- for (int i = 0; i < size; ++i) {
- out.writeByte(bytes[i + offset]);
- }
+ out.write(bytes, offset, size);
}
@Override
- public void readFrom(DataInputStream in) throws IOException,
+ public void readFrom(DataInput in) throws IOException,
IllegalAccessException, InstantiationException {
- int size = in.readInt();
- bytes = new byte[size];
- for (int i = 0; i < size; ++i) {
- bytes[i] = in.readByte();
- }
+ bytes = new byte[in.readInt()];
+ in.readFully(bytes, 0, bytes.length);
}
}
@@ -180,7 +175,7 @@ else if (j < bytes2.length) {
}
@Override
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeInt(bytes1.length);
out.write(bytes1);
out.writeInt(bytes2.length);
@@ -188,7 +183,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
@Override
- public void readFrom(DataInputStream in) throws IOException,
+ public void readFrom(DataInput in) throws IOException,
IllegalAccessException, InstantiationException {
int size = in.readInt();
bytes1 = new byte[size];
View
4 src/org/jgroups/protocols/AuthHeader.java
@@ -31,11 +31,11 @@ public AuthToken getToken(){
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeAuthToken(this.token, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
this.token = Util.readAuthToken(in);
}
public int size(){
View
4 src/org/jgroups/protocols/COMPRESS.java
@@ -188,11 +188,11 @@ public int size() {
return Global.INT_SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeInt(original_size);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
original_size=in.readInt();
}
}
View
8 src/org/jgroups/protocols/DAISYCHAIN.java
@@ -6,8 +6,8 @@
import org.jgroups.util.ConcurrentLinkedBlockingQueue;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
@@ -227,11 +227,11 @@ public int size() {
return Global.SHORT_SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeShort(ttl);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
ttl=in.readShort();
}
View
4 src/org/jgroups/protocols/DISCARD.java
@@ -309,7 +309,7 @@ public DiscardHeader(Set<Address> ignoredAddresses) {
this.dropMessages= ignoredAddresses;
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
int size = in.readShort();
if (size > 0) {
dropMessages.clear();
@@ -319,7 +319,7 @@ public void readFrom(DataInputStream in) throws IOException, IllegalAccessExcept
}
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (dropMessages != null && !dropMessages.isEmpty()) {
out.writeShort(dropMessages.size());
for (Address addr: dropMessages) {
View
9 src/org/jgroups/protocols/ENCRYPT.java
@@ -10,8 +10,8 @@
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.io.InputStream;
import java.security.*;
@@ -19,7 +19,6 @@
import java.security.spec.X509EncodedKeySpec;
import java.util.List;
import java.util.Map;
-import java.util.Vector;
import java.util.WeakHashMap;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
@@ -1193,13 +1192,13 @@ public EncryptHeader(short type,String version) {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeShort(type);
Util.writeString(version, out);
out.writeBoolean(encrypt_entire_msg);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readShort();
version=Util.readString(in);
encrypt_entire_msg=in.readBoolean();
View
15 src/org/jgroups/protocols/Executing.java
@@ -1,11 +1,6 @@
package org.jgroups.protocols;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.io.Serializable;
+import java.io.*;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
import java.util.ArrayList;
@@ -809,7 +804,7 @@ public Request(Type type, Object object, long request) {
this.request=request;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type.ordinal());
// We can't use Util.writeObject since it's size is limited to 2^15-1
try {
@@ -832,7 +827,7 @@ public void writeTo(DataOutputStream out) throws IOException {
out.writeLong(request);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=Type.values()[in.readByte()];
// We can't use Util.readObject since it's size is limited to 2^15-1
try {
@@ -875,10 +870,10 @@ public int size() {
return 0;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
}
}
View
4 src/org/jgroups/protocols/FD.java
@@ -395,14 +395,14 @@ public int size() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
Util.writeAddresses(mbrs, out);
Util.writeAddress(from, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
mbrs=(Collection<Address>)Util.readAddresses(in, Vector.class);
from=Util.readAddress(in);
View
8 src/org/jgroups/protocols/FD_ALL.java
@@ -7,8 +7,8 @@
import org.jgroups.util.TimeScheduler;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
import java.util.Map.Entry;
@@ -324,8 +324,8 @@ void suspect(List<Address> suspects) {
public HeartbeatHeader() {}
public String toString() {return "heartbeat";}
public int size() {return 0;}
- public void writeTo(DataOutputStream out) throws IOException {}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {}
+ public void writeTo(DataOutput out) throws IOException {}
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {}
}
View
4 src/org/jgroups/protocols/FD_SIMPLE.java
@@ -278,11 +278,11 @@ public int size() {
return Global.BYTE_SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
}
View
4 src/org/jgroups/protocols/FD_SOCK.java
@@ -911,7 +911,7 @@ public int size() {
return retval;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
int size;
out.writeByte(type);
Util.writeAddress(mbr, out);
@@ -935,7 +935,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
int size;
type=in.readByte();
mbr=Util.readAddress(in);
View
8 src/org/jgroups/protocols/FcHeader.java
@@ -3,8 +3,8 @@
import org.jgroups.Global;
import org.jgroups.Header;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
/**
@@ -29,11 +29,11 @@ public int size() {
return Global.BYTE_SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
}
View
4 src/org/jgroups/protocols/FragHeader.java
@@ -28,7 +28,7 @@ public String toString() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeLong(id);
out.writeInt(frag_id);
out.writeInt(num_frags);
@@ -38,7 +38,7 @@ public int size() {
return Global.LONG_SIZE + 2*Global.INT_SIZE;
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
id=in.readLong();
frag_id=in.readInt();
num_frags=in.readInt();
View
4 src/org/jgroups/protocols/HTOTAL.java
@@ -147,12 +147,12 @@ public HTotalHeader(Address dest, Address src) {
this.src=src;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeAddress(dest, out);
Util.writeAddress(src, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
dest=Util.readAddress(in);
src=Util.readAddress(in);
}
View
12 src/org/jgroups/protocols/Locking.java
@@ -1,7 +1,7 @@
package org.jgroups.protocols;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
@@ -1250,7 +1250,7 @@ public Request(Type type, String lock_name, Owner owner, long timeout, boolean i
this.is_trylock=is_trylock;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type.ordinal());
Util.writeString(lock_name, out);
Util.writeStreamable(owner, out);
@@ -1258,7 +1258,7 @@ public void writeTo(DataOutputStream out) throws IOException {
out.writeBoolean(is_trylock);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=Type.values()[in.readByte()];
lock_name=Util.readString(in);
owner=(Owner)Util.readStreamable(Owner.class, in);
@@ -1302,10 +1302,10 @@ public int size() {
return 0;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
}
}
View
8 src/org/jgroups/protocols/PingData.java
@@ -8,8 +8,8 @@
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
@@ -116,7 +116,7 @@ public String toString() {
return sb.toString();
}
- public void writeTo(DataOutputStream outstream) throws IOException {
+ public void writeTo(DataOutput outstream) throws IOException {
Util.writeAddress(own_addr, outstream);
Util.writeView(view, outstream);
outstream.writeBoolean(is_server);
@@ -124,7 +124,7 @@ public void writeTo(DataOutputStream outstream) throws IOException {
Util.writeAddresses(physical_addrs, outstream);
}
- public void readFrom(DataInputStream instream) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput instream) throws IOException, IllegalAccessException, InstantiationException {
own_addr=Util.readAddress(instream);
view=Util.readView(instream);
is_server=instream.readBoolean();
View
4 src/org/jgroups/protocols/PingHeader.java
@@ -74,14 +74,14 @@ static String type2Str(byte t) {
}
- public void writeTo(DataOutputStream outstream) throws IOException {
+ public void writeTo(DataOutput outstream) throws IOException {
outstream.writeByte(type);
outstream.writeBoolean(return_view_only);
Util.writeStreamable(arg, outstream);
Util.writeString(cluster_name, outstream);
}
- public void readFrom(DataInputStream instream) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput instream) throws IOException, IllegalAccessException, InstantiationException {
type=instream.readByte();
return_view_only=instream.readBoolean();
arg=(PingData)Util.readStreamable(PingData.class, instream);
View
8 src/org/jgroups/protocols/PrioHeader.java
@@ -3,8 +3,8 @@
import org.jgroups.Global;
import org.jgroups.Header;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
/**
@@ -45,11 +45,11 @@ public int size() {
return Global.BYTE_SIZE;
}
- public void writeTo( DataOutputStream outstream ) throws IOException {
+ public void writeTo( DataOutput outstream ) throws IOException {
outstream.writeByte(priority);
}
- public void readFrom( DataInputStream instream ) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom( DataInput instream ) throws IOException, IllegalAccessException, InstantiationException {
priority=instream.readByte();
}
View
12 src/org/jgroups/protocols/RELAY.java
@@ -8,8 +8,8 @@
import org.jgroups.util.*;
import org.jgroups.util.UUID;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.Future;
@@ -636,7 +636,7 @@ public int size() {
return retval;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type.ordinal());
switch(type) {
case DISSEMINATE:
@@ -649,7 +649,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=Type.values()[in.readByte()];
switch(type) {
case DISSEMINATE:
@@ -700,7 +700,7 @@ public static ViewData create(View remote_view, View global_view) {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeView(remote_view, out);
Util.writeView(global_view, out);
out.writeInt(uuids.size());
@@ -710,7 +710,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
remote_view=Util.readView(in);
global_view=Util.readView(in);
int size=in.readInt();
View
8 src/org/jgroups/protocols/SCOPE.java
@@ -6,8 +6,8 @@
import org.jgroups.annotations.*;
import org.jgroups.stack.Protocol;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
import java.util.Queue;
@@ -502,7 +502,7 @@ public int size() {
}
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
switch(type) {
case MSG:
@@ -514,7 +514,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
switch(type) {
case MSG:
View
4 src/org/jgroups/protocols/SEQUENCER.java
@@ -386,12 +386,12 @@ private final String printType() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
Util.writeStreamable(tag, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
tag=(ViewId)Util.readStreamable(ViewId.class, in);
}
View
8 src/org/jgroups/protocols/SMACK.java
@@ -13,8 +13,8 @@
import org.jgroups.stack.StaticInterval;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.LinkedHashSet;
import java.util.Map;
@@ -269,12 +269,12 @@ public int size() {
return Global.LONG_SIZE + Global.BYTE_SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
out.writeLong(seqno);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
seqno=in.readLong();
}
View
9 src/org/jgroups/protocols/STOMP.java
@@ -6,10 +6,7 @@
import org.jgroups.util.UUID;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.EOFException;
-import java.io.IOException;
+import java.io.*;
import java.net.*;
import java.nio.ByteBuffer;
import java.util.*;
@@ -718,7 +715,7 @@ public int size() {
return retval;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeInt(type.ordinal());
out.writeInt(headers.size());
for(Map.Entry<String,String> entry: headers.entrySet()) {
@@ -727,7 +724,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=Type.values()[in.readInt()];
int size=in.readInt();
for(int i=0; i < size; i++) {
View
4 src/org/jgroups/protocols/TpHeader.java
@@ -32,11 +32,11 @@ public int size() {
return size;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeUTF(channel_name);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
channel_name=in.readUTF();
if(channel_name != null)
size=channel_name.length()+2; // +2 for writeUTF()
View
8 src/org/jgroups/protocols/UNICAST.java
@@ -12,8 +12,8 @@
import org.jgroups.util.Tuple;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ConcurrentMap;
@@ -806,7 +806,7 @@ public UnicastHeader copy() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
switch(type) {
case DATA:
@@ -822,7 +822,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
switch(type) {
case DATA:
View
8 src/org/jgroups/protocols/UNICAST2.java
@@ -11,8 +11,8 @@
import org.jgroups.util.TimeScheduler;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ConcurrentMap;
@@ -933,7 +933,7 @@ public Unicast2Header copy() {
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
switch(type) {
case DATA:
@@ -952,7 +952,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
switch(type) {
case DATA:
View
4 src/org/jgroups/protocols/VERIFY_SUSPECT.java
@@ -316,12 +316,12 @@ public String toString() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeShort(type);
Util.writeAddress(from, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readShort();
from=Util.readAddress(in);
}
View
4 src/org/jgroups/protocols/pbcast/FLUSH.java
@@ -973,7 +973,7 @@ public String toString() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
out.writeLong(viewID);
Util.writeAddresses(flushParticipants, out);
@@ -981,7 +981,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
@SuppressWarnings("unchecked")
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
type = in.readByte();
viewID = in.readLong();
View
4 src/org/jgroups/protocols/pbcast/GMS.java
@@ -1114,7 +1114,7 @@ public static String type2String(int type) {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
boolean isMergeView=view != null && view instanceof MergeView;
out.writeBoolean(isMergeView);
@@ -1128,7 +1128,7 @@ public void writeTo(DataOutputStream out) throws IOException {
out.writeBoolean(useFlushIfPresent);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
boolean isMergeView=in.readBoolean();
if(isMergeView)
View
8 src/org/jgroups/protocols/pbcast/JoinRsp.java
@@ -8,10 +8,10 @@
import org.jgroups.util.Util;
import org.jgroups.util.Digest;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.Serializable;
-import java.io.DataOutputStream;
import java.io.IOException;
-import java.io.DataInputStream;
/**
@@ -56,13 +56,13 @@ public void setFailReason(String r) {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeStreamable(view, out);
Util.writeStreamable(digest, out);
Util.writeString(fail_reason, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
view=(View)Util.readStreamable(View.class, in);
digest=(Digest)Util.readStreamable(Digest.class, in);
fail_reason=Util.readString(in);
View
4 src/org/jgroups/protocols/pbcast/NakAckHeader.java
@@ -77,7 +77,7 @@ public Address getSender() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
switch(type) {
case MSG:
@@ -91,7 +91,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
switch(type) {
case MSG:
View
4 src/org/jgroups/protocols/pbcast/STABLE.java
@@ -760,12 +760,12 @@ public int size() {
return retval;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeInt(type);
Util.writeStreamable(stableDigest, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readInt();
stableDigest=(Digest)Util.readStreamable(Digest.class, in);
}
View
5 src/org/jgroups/protocols/pbcast/STATE_TRANSFER.java
@@ -1,7 +1,6 @@
package org.jgroups.protocols.pbcast;
import org.jgroups.*;
-import org.jgroups.annotations.DeprecatedProperty;
import org.jgroups.annotations.GuardedBy;
import org.jgroups.annotations.MBean;
import org.jgroups.annotations.ManagedAttribute;
@@ -515,7 +514,7 @@ static String type2Str(int t) {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
out.writeLong(id);
Util.writeAddress(sender, out);
@@ -523,7 +522,7 @@ public void writeTo(DataOutputStream out) throws IOException {
Util.writeString(state_id, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
id=in.readLong();
sender=Util.readAddress(in);
View
4 src/org/jgroups/protocols/pbcast/STREAMING_STATE_TRANSFER.java
@@ -972,7 +972,7 @@ static String type2Str(int t) {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
out.writeLong(id);
Util.writeAddress(sender, out);
@@ -981,7 +981,7 @@ public void writeTo(DataOutputStream out) throws IOException {
Util.writeString(state_id, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
type = in.readByte();
id = in.readLong();
View
8 src/org/jgroups/stack/GossipData.java
@@ -8,8 +8,8 @@
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
@@ -105,7 +105,7 @@ public String toString() {
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeByte(type);
Util.writeString(group, out);
Util.writeAddress(addr, out);
@@ -115,7 +115,7 @@ public void writeTo(DataOutputStream out) throws IOException {
Util.writeByteBuffer(buffer, offset, length, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
type=in.readByte();
group=Util.readString(in);
addr=Util.readAddress(in);
View
4 src/org/jgroups/stack/IpAddress.java
@@ -241,7 +241,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
}
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if(ip_addr != null) {
byte[] address=ip_addr.getAddress(); // 4 bytes (IPv4) or 16 bytes (IPv6)
out.writeByte(address.length); // 1 byte
@@ -263,7 +263,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException {
+ public void readFrom(DataInput in) throws IOException {
int len=in.readByte();
if(len > 0 && (len != Global.IPV4_SIZE && len != Global.IPV6_SIZE))
throw new IOException("length has to be " + Global.IPV4_SIZE + " or " + Global.IPV6_SIZE + " bytes (was " +
View
4 src/org/jgroups/util/AdditionalDataUUID.java
@@ -57,12 +57,12 @@ public int size() {
return retval;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
super.writeTo(out);
Util.writeByteBuffer(payload, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
super.readFrom(in);
payload=Util.readByteBuffer(in);
}
View
8 src/org/jgroups/util/Digest.java
@@ -354,7 +354,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
senders.putAll(tmp);
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeShort(senders.size());
for(Map.Entry<Address,Entry> entry: senders.entrySet()) {
Entry val=entry.getValue();
@@ -366,7 +366,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
short size=in.readShort();
Map<Address,Entry> tmp=new HashMap<Address, Entry>(size);
Address key;
@@ -478,13 +478,13 @@ public static int size() {
return SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeLong(low_seqno);
out.writeLong(highest_delivered_seqno);
out.writeLong(highest_received_seqno);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
low_seqno=in.readLong();
highest_delivered_seqno=in.readLong();
highest_received_seqno=in.readLong();
View
8 src/org/jgroups/util/MergeId.java
@@ -3,9 +3,9 @@
import org.jgroups.Address;
import org.jgroups.Global;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
-import java.io.DataInputStream;
/** ID to uniquely identify a merge
* @author Bela Ban
@@ -41,12 +41,12 @@ public int size() {
return Util.size(initiator) + Global.INT_SIZE;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeAddress(initiator, out);
out.writeInt(id);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
initiator=Util.readAddress(in);
id=in.readInt();
}
View
4 src/org/jgroups/util/PayloadUUID.java
@@ -64,12 +64,12 @@ public int size() {
return retval;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
super.writeTo(out);
Util.writeString(payload, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
super.readFrom(in);
payload=Util.readString(in);
}
View
4 src/org/jgroups/util/Range.java
@@ -53,12 +53,12 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeLong(low);
out.writeLong(high);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
low=in.readLong();
high=in.readLong();
}
View
4 src/org/jgroups/util/SingletonAddress.java
@@ -49,11 +49,11 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
throw new UnsupportedOperationException();
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
throw new UnsupportedOperationException();
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
throw new UnsupportedOperationException();
}
View
8 src/org/jgroups/util/Streamable.java
@@ -1,7 +1,7 @@
package org.jgroups.util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
/**
@@ -13,9 +13,9 @@
/** Write the entire state of the current object (including superclasses) to outstream.
* Note that the output stream <em>must not</em> be closed */
- void writeTo(DataOutputStream out) throws IOException;
+ void writeTo(DataOutput out) throws IOException;
/** Read the state of the current object (including superclasses) from instream
* Note that the input stream <em>must not</em> be closed */
- void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException;
+ void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException;
}
View
4 src/org/jgroups/util/TopologyUUID.java
@@ -86,14 +86,14 @@ public int size() {
return retval;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
super.writeTo(out);
Util.writeString(site_id, out);
Util.writeString(rack_id, out);
Util.writeString(machine_id, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
super.readFrom(in);
site_id=Util.readString(in);
rack_id=Util.readString(in);
View
4 src/org/jgroups/util/UUID.java
@@ -258,12 +258,12 @@ public int compareTo(Address other) {
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeLong(leastSigBits);
out.writeLong(mostSigBits);
}