Package one.nio.util
Class DigestStream
java.lang.Object
one.nio.util.DigestStream
- All Implemented Interfaces:
DataOutput,ObjectOutput,AutoCloseable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDigestStream(String algorithm) DigestStream(MessageDigest md, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()byte[]digest()longdigest64()voidflush()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) voidwriteChar(int v) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidwriteObject(Object obj) voidwriteShort(int v) void
-
Field Details
-
md
-
buf
protected byte[] buf
-
-
Constructor Details
-
DigestStream
-
DigestStream
-
-
Method Details
-
digest
public byte[] digest() -
digest64
public long digest64() -
write
public void write(int b) - Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput
-
write
public void write(byte[] b) - Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput
-
write
public void write(byte[] b, int off, int len) - Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput
-
writeBoolean
public void writeBoolean(boolean v) - Specified by:
writeBooleanin interfaceDataOutput
-
writeByte
public void writeByte(int v) - Specified by:
writeBytein interfaceDataOutput
-
writeShort
public void writeShort(int v) - Specified by:
writeShortin interfaceDataOutput
-
writeChar
public void writeChar(int v) - Specified by:
writeCharin interfaceDataOutput
-
writeInt
public void writeInt(int v) - Specified by:
writeIntin interfaceDataOutput
-
writeLong
public void writeLong(long v) - Specified by:
writeLongin interfaceDataOutput
-
writeFloat
public void writeFloat(float v) - Specified by:
writeFloatin interfaceDataOutput
-
writeDouble
public void writeDouble(double v) - Specified by:
writeDoublein interfaceDataOutput
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput
-
writeObject
- Specified by:
writeObjectin interfaceObjectOutput
-
flush
public void flush()- Specified by:
flushin interfaceObjectOutput
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceObjectOutput
-