@Override public void writeStream(DataInputBlobReader input, int length) { checkLimit(this, length); super.writeStream(input, length); }
@Override public void writeStream(DataInputBlobReader input, int length) { checkLimit(this, length); super.writeStream(input, length); }
/** * Copies bytes from specified pipe to target pipe * @param sourcePipe to copy from * @param targetPipe to copy to * @param sourceLOC location of bytes to copy * @param targetLOC location to put bytes * @return length of copied bytes */ public static int copyBytes(final Pipe sourcePipe, final Pipe targetPipe, int sourceLOC, int targetLOC) { assert(LOCUtil.isLocOfAnyType(sourceLOC, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(sourceLOC); assert(LOCUtil.isLocOfAnyType(targetLOC, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(targetLOC); //alternate implementation DataInputBlobReader src = PipeReader.inputStream(sourcePipe, sourceLOC); DataOutputBlobWriter tgt = PipeWriter.outputStream(targetPipe); DataOutputBlobWriter.openField(tgt); int len = src.available(); tgt.writeStream(src, len); if (src.isStructured) { src.readFromEndInto(tgt); } DataOutputBlobWriter.closeHighLevelField(tgt, targetLOC); return len; }
/** * Copies bytes from specified pipe to target pipe * @param sourcePipe to copy from * @param targetPipe to copy to * @param sourceLOC location of bytes to copy * @param targetLOC location to put bytes * @return length of copied bytes */ public static int copyBytes(final Pipe sourcePipe, final Pipe targetPipe, int sourceLOC, int targetLOC) { assert(LOCUtil.isLocOfAnyType(sourceLOC, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(sourceLOC); assert(LOCUtil.isLocOfAnyType(targetLOC, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(targetLOC); //alternate implementation DataInputBlobReader src = PipeReader.inputStream(sourcePipe, sourceLOC); DataOutputBlobWriter tgt = PipeWriter.outputStream(targetPipe); DataOutputBlobWriter.openField(tgt); int len = src.available(); tgt.writeStream(src, len); if (src.isStructured) { src.readFromEndInto(tgt); } DataOutputBlobWriter.closeHighLevelField(tgt, targetLOC); return len; }
/** * Copies bytes from specified pipe to target pipe * @param sourcePipe to copy from * @param targetPipe to copy to * @param sourceLOC location of bytes to copy * @param targetLOC location to put bytes * @return length of copied bytes */ public static int copyBytes(final Pipe sourcePipe, final Pipe targetPipe, int sourceLOC, int targetLOC) { assert(LOCUtil.isLocOfAnyType(sourceLOC, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(sourceLOC); assert(LOCUtil.isLocOfAnyType(targetLOC, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.TextUTF8, TypeMask.TextUTF8Optional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(targetLOC); //alternate implementation DataInputBlobReader src = PipeReader.inputStream(sourcePipe, sourceLOC); DataOutputBlobWriter tgt = PipeWriter.outputStream(targetPipe); DataOutputBlobWriter.openField(tgt); int len = src.available(); tgt.writeStream(src, len); if (src.isStructured) { src.readFromEndInto(tgt); } DataOutputBlobWriter.closeHighLevelField(tgt, targetLOC); return len; }