commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [2/3] commons-rng git commit: RNG-10
Date Fri, 19 Aug 2016 22:31:36 GMT
RNG-10

Update userguide.


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/82642ca1
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/82642ca1
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/82642ca1

Branch: refs/heads/RNG-10__no_serializable
Commit: 82642ca1a5fa7c63b8f0fc2f522ac84c9545afdb
Parents: f6528f0
Author: Gilles <erans@apache.org>
Authored: Sat Aug 20 02:27:37 2016 +0200
Committer: Gilles <erans@apache.org>
Committed: Sat Aug 20 02:27:37 2016 +0200

----------------------------------------------------------------------
 src/site/apt/userguide/rng.apt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/82642ca1/src/site/apt/userguide/rng.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/userguide/rng.apt b/src/site/apt/userguide/rng.apt
index adc4170..b9f72dd 100644
--- a/src/site/apt/userguide/rng.apt
+++ b/src/site/apt/userguide/rng.apt
@@ -202,12 +202,12 @@ UniformRandomProvider rngOrig = RandomSource.create(source); // Original
RNG ins
 RandomSource.State stateOrig = RandomSource.saveState(rngOrig);
 ByteArrayOutputStream bos = new ByteArrayOutputStream();
 ObjectOutputStream oos = new ObjectOutputStream(bos);
-oos.writeObject(stateOrig);
+oos.writeObject(stateOrig.getState());
 
 // Deserialize state.
 ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
 ObjectInputStream ois = new ObjectInputStream(bis);
-RandomSource.State stateNew = (RandomSource.State) ois.readObject();
+RandomSource.State stateNew = new RandomSource.State((byte[]) ois.readObject());
 
 UniformRandomProvider rngNew = RandomSource.create(source); // New RNG instance from the
same "source".
 


Mime
View raw message