本文整理汇总了Java中com.ociweb.pronghorn.pipe.PipeWriter.writeBytes方法的典型用法代码示例。如果您正苦于以下问题:Java PipeWriter.writeBytes方法的具体用法?Java PipeWriter.writeBytes怎么用?Java PipeWriter.writeBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ociweb.pronghorn.pipe.PipeWriter
的用法示例。
在下文中一共展示了PipeWriter.writeBytes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeWithAckImpl
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
private void writeWithAckImpl(boolean encryption, boolean telemetry) {
Pipe<PersistedBlobStoreSchema> perStore = PersistedBlobStoreSchema.instance.newPipe(10, 1000);
perStore.initBuffers();
long fieldBlockId = 10;
byte[] fieldByteArrayBacking = "hello".getBytes();
int fieldByteArrayPosition = 0;
int fieldByteArrayLength = fieldByteArrayBacking.length;
PipeWriter.presumeWriteFragment(perStore, PersistedBlobStoreSchema.MSG_BLOCK_1);
PipeWriter.writeLong(perStore,PersistedBlobStoreSchema.MSG_BLOCK_1_FIELD_BLOCKID_3, fieldBlockId);
PipeWriter.writeBytes(perStore,PersistedBlobStoreSchema.MSG_BLOCK_1_FIELD_BYTEARRAY_2, fieldByteArrayBacking, fieldByteArrayPosition, fieldByteArrayLength);
PipeWriter.publishWrites(perStore);
PipeWriter.publishEOF(perStore);
String result = runGraph(perStore, encryption, telemetry);
assertTrue(result, result.indexOf("AckWrite")>0);
assertTrue(result, result.indexOf("{\"BlockId\":10}")>0);
}
示例2: publishPublish
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishPublish(Pipe<MessagePubSub> output, int fieldQOS, CharSequence fieldTopic, byte[] fieldPayloadBacking, int fieldPayloadPosition, int fieldPayloadLength) {
PipeWriter.presumeWriteFragment(output, MSG_PUBLISH_103);
PipeWriter.writeInt(output,MSG_PUBLISH_103_FIELD_QOS_5, fieldQOS);
PipeWriter.writeUTF8(output,MSG_PUBLISH_103_FIELD_TOPIC_1, fieldTopic);
PipeWriter.writeBytes(output,MSG_PUBLISH_103_FIELD_PAYLOAD_3, fieldPayloadBacking, fieldPayloadPosition, fieldPayloadLength);
PipeWriter.publishWrites(output);
}
示例3: publishToChannel
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishToChannel(Pipe<ServerResponseSchema> output, long fieldChannelId, int fieldSequenceNo, byte[] fieldPayloadBacking, int fieldPayloadPosition, int fieldPayloadLength, int fieldRequestContext) {
PipeWriter.presumeWriteFragment(output, MSG_TOCHANNEL_100);
PipeWriter.writeLong(output,MSG_TOCHANNEL_100_FIELD_CHANNELID_21, fieldChannelId);
PipeWriter.writeInt(output,MSG_TOCHANNEL_100_FIELD_SEQUENCENO_23, fieldSequenceNo);
PipeWriter.writeBytes(output,MSG_TOCHANNEL_100_FIELD_PAYLOAD_25, fieldPayloadBacking, fieldPayloadPosition, fieldPayloadLength);
PipeWriter.writeInt(output,MSG_TOCHANNEL_100_FIELD_REQUESTCONTEXT_24, fieldRequestContext);
PipeWriter.publishWrites(output);
}
示例4: write
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
@Override
public int write(byte[] data) {
if (PipeWriter.tryWriteFragment(pipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)) {
PipeWriter.writeBytes(pipe,RawDataSchema.MSG_CHUNKEDSTREAM_1_FIELD_BYTEARRAY_2, data, 0, data.length);
PipeWriter.publishWrites(pipe);
return data.length;
} else {
return 0;
}
}
示例5: publishBlockAllocated
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static boolean publishBlockAllocated(Pipe<BlockManagerResponseSchema> output, byte[] fieldRouteBacking, int fieldRoutePosition, int fieldRouteLength) {
boolean result = false;
if (PipeWriter.tryWriteFragment(output, MSG_BLOCKALLOCATED_6)) {
PipeWriter.writeBytes(output,MSG_BLOCKALLOCATED_6_FIELD_ROUTE_14, fieldRouteBacking, fieldRoutePosition, fieldRouteLength);
PipeWriter.publishWrites(output);
result = true;
}
return result;
}
示例6: writeFrom
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
@Override
public int writeFrom(byte[] backing, int pos, int length) {
if (PipeWriter.tryWriteFragment(pipe, RawDataSchema.MSG_CHUNKEDSTREAM_1)) {
PipeWriter.writeBytes(pipe,RawDataSchema.MSG_CHUNKEDSTREAM_1_FIELD_BYTEARRAY_2, backing, pos, length);
PipeWriter.publishWrites(pipe);
return length; //must be length to indicate all consumed
} else {
return 0;//did nothing since we can not write
}
}
示例7: publishEncrypted
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishEncrypted(Pipe<NetPayloadSchema> output, long fieldConnectionId, long fieldArrivalTime, byte[] fieldPayloadBacking, int fieldPayloadPosition, int fieldPayloadLength) {
PipeWriter.presumeWriteFragment(output, MSG_ENCRYPTED_200);
PipeWriter.writeLong(output,MSG_ENCRYPTED_200_FIELD_CONNECTIONID_201, fieldConnectionId);
PipeWriter.writeLong(output,MSG_ENCRYPTED_200_FIELD_ARRIVALTIME_210, fieldArrivalTime);
PipeWriter.writeBytes(output,MSG_ENCRYPTED_200_FIELD_PAYLOAD_203, fieldPayloadBacking, fieldPayloadPosition, fieldPayloadLength);
PipeWriter.publishWrites(output);
}
示例8: publishPlain
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishPlain(Pipe<NetPayloadSchema> output, long fieldConnectionId, long fieldArrivalTime, long fieldPosition, byte[] fieldPayloadBacking, int fieldPayloadPosition, int fieldPayloadLength) {
PipeWriter.presumeWriteFragment(output, MSG_PLAIN_210);
PipeWriter.writeLong(output,MSG_PLAIN_210_FIELD_CONNECTIONID_201, fieldConnectionId);
PipeWriter.writeLong(output,MSG_PLAIN_210_FIELD_ARRIVALTIME_210, fieldArrivalTime);
PipeWriter.writeLong(output,MSG_PLAIN_210_FIELD_POSITION_206, fieldPosition);
PipeWriter.writeBytes(output,MSG_PLAIN_210_FIELD_PAYLOAD_204, fieldPayloadBacking, fieldPayloadPosition, fieldPayloadLength);
PipeWriter.publishWrites(output);
}
示例9: publishBlockMount
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static boolean publishBlockMount(Pipe<BlockManagerRequestSchema> output, byte[] fieldRouteBacking, int fieldRoutePosition, int fieldRouteLength) {
boolean result = false;
if (PipeWriter.tryWriteFragment(output, MSG_BLOCKMOUNT_5)) {
PipeWriter.writeBytes(output,MSG_BLOCKMOUNT_5_FIELD_ROUTE_14, fieldRouteBacking, fieldRoutePosition, fieldRouteLength);
PipeWriter.publishWrites(output);
result = true;
}
return result;
}
示例10: publishSubRelease
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static boolean publishSubRelease(Pipe<BlockManagerRequestSchema> output, long fieldId, byte[] fieldRouteBacking, int fieldRoutePosition, int fieldRouteLength) {
boolean result = false;
if (PipeWriter.tryWriteFragment(output, MSG_SUBRELEASE_2)) {
PipeWriter.writeLong(output,MSG_SUBRELEASE_2_FIELD_ID_11, fieldId);
PipeWriter.writeBytes(output,MSG_SUBRELEASE_2_FIELD_ROUTE_14, fieldRouteBacking, fieldRoutePosition, fieldRouteLength);
PipeWriter.publishWrites(output);
result = true;
}
return result;
}
示例11: publishConnect
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishConnect(Pipe<MQTTClientToServerSchema> output, long fieldTime, int fieldKeepAliveSec, int fieldFlags, CharSequence fieldClientId, CharSequence fieldWillTopic, byte[] fieldWillPayloadBacking, int fieldWillPayloadPosition, int fieldWillPayloadLength, CharSequence fieldUser, CharSequence fieldPass) {
PipeWriter.presumeWriteFragment(output, MSG_CONNECT_1);
PipeWriter.writeLong(output,MSG_CONNECT_1_FIELD_TIME_37, fieldTime);
PipeWriter.writeInt(output,MSG_CONNECT_1_FIELD_KEEPALIVESEC_28, fieldKeepAliveSec);
PipeWriter.writeInt(output,MSG_CONNECT_1_FIELD_FLAGS_29, fieldFlags);
PipeWriter.writeUTF8(output,MSG_CONNECT_1_FIELD_CLIENTID_30, fieldClientId);
PipeWriter.writeUTF8(output,MSG_CONNECT_1_FIELD_WILLTOPIC_31, fieldWillTopic);
PipeWriter.writeBytes(output,MSG_CONNECT_1_FIELD_WILLPAYLOAD_32, fieldWillPayloadBacking, fieldWillPayloadPosition, fieldWillPayloadLength);
PipeWriter.writeUTF8(output,MSG_CONNECT_1_FIELD_USER_33, fieldUser);
PipeWriter.writeUTF8(output,MSG_CONNECT_1_FIELD_PASS_34, fieldPass);
PipeWriter.publishWrites(output);
}
示例12: publishPublish
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishPublish(Pipe<MQTTClientToServerSchema> output, long fieldTime, int fieldPacketId, int fieldQOS, int fieldRetain, CharSequence fieldTopic, byte[] fieldPayloadBacking, int fieldPayloadPosition, int fieldPayloadLength) {
PipeWriter.presumeWriteFragment(output, MSG_PUBLISH_3);
PipeWriter.writeLong(output,MSG_PUBLISH_3_FIELD_TIME_37, fieldTime);
PipeWriter.writeInt(output,MSG_PUBLISH_3_FIELD_PACKETID_20, fieldPacketId);
PipeWriter.writeInt(output,MSG_PUBLISH_3_FIELD_QOS_21, fieldQOS);
PipeWriter.writeInt(output,MSG_PUBLISH_3_FIELD_RETAIN_22, fieldRetain);
PipeWriter.writeUTF8(output,MSG_PUBLISH_3_FIELD_TOPIC_23, fieldTopic);
PipeWriter.writeBytes(output,MSG_PUBLISH_3_FIELD_PAYLOAD_25, fieldPayloadBacking, fieldPayloadPosition, fieldPayloadLength);
PipeWriter.publishWrites(output);
}
示例13: publishPublish
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishPublish(Pipe<MQTTServerToClientSchema> output, long fieldTime, int fieldQOS, int fieldRetain, int fieldDup, CharSequence fieldTopic, int fieldPacketId, byte[] fieldPayloadBacking, int fieldPayloadPosition, int fieldPayloadLength) {
PipeWriter.presumeWriteFragment(output, MSG_PUBLISH_3);
PipeWriter.writeLong(output,MSG_PUBLISH_3_FIELD_TIME_37, fieldTime);
PipeWriter.writeInt(output,MSG_PUBLISH_3_FIELD_QOS_21, fieldQOS);
PipeWriter.writeInt(output,MSG_PUBLISH_3_FIELD_RETAIN_22, fieldRetain);
PipeWriter.writeInt(output,MSG_PUBLISH_3_FIELD_DUP_36, fieldDup);
PipeWriter.writeUTF8(output,MSG_PUBLISH_3_FIELD_TOPIC_23, fieldTopic);
PipeWriter.writeInt(output,MSG_PUBLISH_3_FIELD_PACKETID_20, fieldPacketId);
PipeWriter.writeBytes(output,MSG_PUBLISH_3_FIELD_PAYLOAD_25, fieldPayloadBacking, fieldPayloadPosition, fieldPayloadLength);
PipeWriter.publishWrites(output);
}
示例14: publishReadHeader
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static boolean publishReadHeader(Pipe<BlockManagerResponseSchema> output, long fieldId, byte[] fieldPayloadBacking, int fieldPayloadPosition, int fieldPayloadLength) {
boolean result = false;
if (PipeWriter.tryWriteFragment(output, MSG_READHEADER_8)) {
PipeWriter.writeLong(output,MSG_READHEADER_8_FIELD_ID_11, fieldId);
PipeWriter.writeBytes(output,MSG_READHEADER_8_FIELD_PAYLOAD_13, fieldPayloadBacking, fieldPayloadPosition, fieldPayloadLength);
PipeWriter.publishWrites(output);
result = true;
}
return result;
}
示例15: publishHTTPPostChunked
import com.ociweb.pronghorn.pipe.PipeWriter; //导入方法依赖的package包/类
public static void publishHTTPPostChunked(Pipe<ClientHTTPRequestSchema> output, int fieldDestination, int fieldSession, int fieldPort, CharSequence fieldHost, CharSequence fieldPath, long fieldTotalLength, byte[] fieldPayloadChunkBacking, int fieldPayloadChunkPosition, int fieldPayloadChunkLength) {
PipeWriter.presumeWriteFragment(output, MSG_HTTPPOSTCHUNKED_102);
PipeWriter.writeInt(output,MSG_HTTPPOSTCHUNKED_102_FIELD_DESTINATION_11, fieldDestination);
PipeWriter.writeInt(output,MSG_HTTPPOSTCHUNKED_102_FIELD_SESSION_10, fieldSession);
PipeWriter.writeInt(output,MSG_HTTPPOSTCHUNKED_102_FIELD_PORT_1, fieldPort);
PipeWriter.writeUTF8(output,MSG_HTTPPOSTCHUNKED_102_FIELD_HOST_2, fieldHost);
PipeWriter.writeUTF8(output,MSG_HTTPPOSTCHUNKED_102_FIELD_PATH_3, fieldPath);
PipeWriter.writeLong(output,MSG_HTTPPOSTCHUNKED_102_FIELD_TOTALLENGTH_6, fieldTotalLength);
PipeWriter.writeBytes(output,MSG_HTTPPOSTCHUNKED_102_FIELD_PAYLOADCHUNK_5, fieldPayloadChunkBacking, fieldPayloadChunkPosition, fieldPayloadChunkLength);
PipeWriter.publishWrites(output);
}