changeset 7:e7e55c455e39 default tip

refactor
author sugi
date Fri, 09 Jan 2015 16:02:44 +0900
parents 8d782f988d92
children
files src/main/java/org/msgpack/unpacker/Converter.java src/main/java/org/msgpack/unpacker/MessagePackBufferUnpacker.java src/main/java/org/msgpack/unpacker/MessagePackUnpacker.java src/main/java/org/msgpack/unpacker/Unpacker.java
diffstat 4 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/msgpack/unpacker/Converter.java	Fri Jan 09 15:14:00 2015 +0900
+++ b/src/main/java/org/msgpack/unpacker/Converter.java	Fri Jan 09 16:02:44 2015 +0900
@@ -435,4 +435,9 @@
     public void setMapSizeLimit(int size) {
         throw new UnsupportedOperationException("Not implemented yet");
     }
+
+    @Override
+    public byte[] getSerializedByteArray(int len) {
+        throw new UnsupportedOperationException("Not implemented yet");
+    }
 }
--- a/src/main/java/org/msgpack/unpacker/MessagePackBufferUnpacker.java	Fri Jan 09 15:14:00 2015 +0900
+++ b/src/main/java/org/msgpack/unpacker/MessagePackBufferUnpacker.java	Fri Jan 09 16:02:44 2015 +0900
@@ -106,9 +106,13 @@
         reset();
     }
 
-    public byte[] getSerializedByteArray(int len) throws IOException {
+    public byte[] getSerializedByteArray(int len) {
         byte[] b = new byte[len];
-        in.read(b, 0, b.length);
+        try {
+            in.read(b, 0, b.length);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
         return b;
     }
 }
--- a/src/main/java/org/msgpack/unpacker/MessagePackUnpacker.java	Fri Jan 09 15:14:00 2015 +0900
+++ b/src/main/java/org/msgpack/unpacker/MessagePackUnpacker.java	Fri Jan 09 16:02:44 2015 +0900
@@ -683,9 +683,13 @@
         in.resetReadByteCount();
     }
 
-    public byte[] getSerializedByteArray(int len) throws IOException {
+    public byte[] getSerializedByteArray(int len) {
         byte[] b = new byte[len];
-        in.read(b, 0, b.length);
+        try {
+            in.read(b, 0, b.length);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
         return b;
     }
 }
--- a/src/main/java/org/msgpack/unpacker/Unpacker.java	Fri Jan 09 15:14:00 2015 +0900
+++ b/src/main/java/org/msgpack/unpacker/Unpacker.java	Fri Jan 09 16:02:44 2015 +0900
@@ -29,7 +29,7 @@
 
 /**
  * Standard deserializer.
- * 
+ *
  * @version 0.6.0
  */
 public interface Unpacker extends Iterable<Value>, Closeable {
@@ -96,4 +96,6 @@
     public void setArraySizeLimit(int size);
 
     public void setMapSizeLimit(int size);
+
+    public byte[] getSerializedByteArray(int len);
 }