本文整理了Java中java.io.ObjectInputStream.readFully()
方法的一些代码示例,展示了ObjectInputStream.readFully()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectInputStream.readFully()
方法的具体详情如下:
包路径:java.io.ObjectInputStream
类名称:ObjectInputStream
方法名:readFully
[英]Reads bytes from the source stream into the byte array dst. This method will block until dst.length bytes have been read.
[中]将源流中的字节读入字节数组dst。此方法将一直阻塞到dst。已读取长度字节。
代码示例来源:origin: redisson/redisson
@Override
public void readFully(byte[] buf) throws IOException {
wrapped.readFully(buf);
}
代码示例来源:origin: redisson/redisson
@Override
public void readFully(byte[] buf, int off, int len) throws IOException {
wrapped.readFully(buf, off, len);
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public byte[] readBytes() throws IOException {
int len = inputStream.readInt();
if (len < 0) {
return null;
} else if (len == 0) {
return new byte[]{};
} else {
byte[] result = new byte[len];
inputStream.readFully(result);
return result;
}
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public byte[] readBytes() throws IOException {
int len = inputStream.readInt();
if (len < 0) {
return null;
} else if (len == 0) {
return new byte[]{};
} else {
byte[] result = new byte[len];
inputStream.readFully(result);
return result;
}
}
}
代码示例来源:origin: wildfly/wildfly
/** {@inheritDoc} */
public void readFully(final byte[] buf, final int off, final int len) throws IOException {
ois.readFully(buf, off, len);
}
代码示例来源:origin: wildfly/wildfly
/** {@inheritDoc} */
public void readFully(final byte[] buf) throws IOException {
ois.readFully(buf);
}
代码示例来源:origin: RuedigerMoeller/fast-serialization
@Override
public void readFully(byte[] buf, int off, int len) throws IOException {
wrapped.readFully(buf, off, len);
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public void readFully(@NotNull byte[] b) throws IOException {
ois.readFully(b);
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public void readFully(@NotNull byte[] b, int off, int len) throws IOException {
ois.readFully(b, off, len);
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public void readFully(@NotNull byte[] b) throws IOException {
ois.readFully(b);
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public void readFully(@NotNull byte[] b, int off, int len) throws IOException {
ois.readFully(b, off, len);
}
代码示例来源:origin: wildfly/wildfly
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
int size = in.readInt();
byte[] bytes = null;
if (size > 0) {
bytes = new byte[size];
in.readFully(bytes);
}
this.bytes = bytes;
}
代码示例来源:origin: apache/storm
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
ois.defaultReadObject();
byte[] ser = new byte[ois.readInt()];
ois.readFully(ser);
this.thriftGrouping = TridentUtils.thriftDeserialize(Grouping.class, ser);
}
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public byte[] readBytes() throws IOException {
int len = getObjectInputStream().readInt();
if (len < 0) {
return null;
}
if (len == 0) {
return new byte[0];
}
if (len > MAX_BYTE_ARRAY_LENGTH) {
throw new IOException("Byte array length too large. " + len);
}
byte[] b = new byte[len];
getObjectInputStream().readFully(b);
return b;
}
代码示例来源:origin: apache/incubator-dubbo
@Override
public byte[] readBytes() throws IOException {
int len = getObjectInputStream().readInt();
if (len < 0) {
return null;
}
if (len == 0) {
return new byte[0];
}
if (len > MAX_BYTE_ARRAY_LENGTH) {
throw new IOException("Byte array length too large. " + len);
}
byte[] b = new byte[len];
getObjectInputStream().readFully(b);
return b;
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
in.defaultReadObject();
int len = in.readInt();
if (len < 0 || len > MAX_SIZE) {
throw new IOException("Illegal buffer length " + len);
}
byte[] x = new byte[len];
in.readFully(x);
fd = ByteBuffer.wrap(x);
}
代码示例来源:origin: alibaba/jstorm
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
ois.defaultReadObject();
byte[] ser = new byte[ois.readInt()];
ois.readFully(ser);
this.thriftGrouping = TridentUtils.thriftDeserialize(Grouping.class, ser);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
private void readObject(ObjectInputStream in
) throws IOException, ClassNotFoundException {
byte[] buf = new byte[in.readInt()];
in.readFully(buf);
metadata = new Metadata(buf);
}
代码示例来源:origin: apache/flink
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
byte codecByte = in.readByte();
if (codecByte >= 0) {
setCodec(Codec.forCodecByte(codecByte));
}
int length = in.readInt();
if (length != 0) {
byte[] json = new byte[length];
in.readFully(json);
Schema schema = new Schema.Parser().parse(new String(json, ConfigConstants.DEFAULT_CHARSET));
setSchema(schema);
}
}
代码示例来源:origin: apache/flink
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
// read the non-transient fields
in.defaultReadObject();
// read the default value field
boolean hasDefaultValue = in.readBoolean();
if (hasDefaultValue) {
int size = in.readInt();
byte[] buffer = new byte[size];
in.readFully(buffer);
try (ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
DataInputViewStreamWrapper inView = new DataInputViewStreamWrapper(bais)) {
defaultValue = serializer.deserialize(inView);
}
catch (Exception e) {
throw new IOException("Unable to deserialize default value.", e);
}
} else {
defaultValue = null;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!