This commit is contained in:
wentch
2016-01-06 14:37:17 +08:00
parent 00958d0dae
commit 9704d5890f
2 changed files with 10 additions and 10 deletions

View File

@@ -105,16 +105,16 @@ public final class BsonConvert extends Convert<BsonReader, BsonWriter> {
return rs;
}
public <T> T convertFrom(final Type type, final ByteBuffer... buffers) {
if (type == null || buffers.length < 1) return null;
return (T) factory.loadDecoder(type).convertFrom(new BsonByteBufferReader(buffers));
}
public <T> T convertFrom(final Type type, final InputStream in) {
if (type == null || in == null) return null;
return (T) factory.loadDecoder(type).convertFrom(new BsonStreamReader(in));
}
public <T> T convertFrom(final Type type, final ByteBuffer... buffers) {
if (type == null || buffers.length < 1) return null;
return (T) factory.loadDecoder(type).convertFrom(new BsonByteBufferReader(buffers));
}
public <T> T convertFrom(final Type type, final BsonReader reader) {
if (type == null) return null;
@SuppressWarnings("unchecked")

View File

@@ -100,16 +100,16 @@ public final class JsonConvert extends Convert<JsonReader, JsonWriter> {
return rs;
}
public <T> T convertFrom(final Type type, final ByteBuffer... buffers) {
if (type == null || buffers == null || buffers.length == 0) return null;
return (T) factory.loadDecoder(type).convertFrom(new JsonByteBufferReader(buffers));
}
public <T> T convertFrom(final Type type, final InputStream in) {
if (type == null || in == null) return null;
return (T) factory.loadDecoder(type).convertFrom(new JsonStreamReader(in));
}
public <T> T convertFrom(final Type type, final ByteBuffer... buffers) {
if (type == null || buffers == null || buffers.length == 0) return null;
return (T) factory.loadDecoder(type).convertFrom(new JsonByteBufferReader(buffers));
}
public <T> T convertFrom(final Type type, final JsonReader reader) {
if (type == null) return null;
@SuppressWarnings("unchecked")