本文整理了Java中org.apache.activemq.util.ByteArrayOutputStream.size()
方法的一些代码示例,展示了ByteArrayOutputStream.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteArrayOutputStream.size()
方法的具体详情如下:
包路径:org.apache.activemq.util.ByteArrayOutputStream
类名称:ByteArrayOutputStream
方法名:size
暂无
代码示例来源:origin: apache/activemq
protected int remaining(ByteArrayOutputStream buffer) {
return datagramSize - buffer.size();
}
代码示例来源:origin: apache/activemq
headerMarshaller.writeHeader(command, dataOut);
int offset = writeBuffer.size();
代码示例来源:origin: org.apache.activemq/activemq-client
protected int remaining(ByteArrayOutputStream buffer) {
return datagramSize - buffer.size();
}
代码示例来源:origin: org.apache.activemq/activemq-all
protected int remaining(ByteArrayOutputStream buffer) {
return datagramSize - buffer.size();
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
protected int remaining(ByteArrayOutputStream buffer) {
return datagramSize - buffer.size();
}
代码示例来源:origin: pierre/meteo
protected int remaining(ByteArrayOutputStream buffer) {
return datagramSize - buffer.size();
}
代码示例来源:origin: org.apache.activemq/activemq-all
httpMethod.addHeader("Content-Type", "application/x-gzip");
if (LOG.isTraceEnabled()) {
LOG.trace("Sending compressed, size = " + bytes.length + ", compressed size = " + bytesOut.size());
代码示例来源:origin: org.apache.activemq/activemq-osgi
httpMethod.addHeader("Content-Type", "application/x-gzip");
if (LOG.isTraceEnabled()) {
LOG.trace("Sending compressed, size = " + bytes.length + ", compressed size = " + bytesOut.size());
代码示例来源:origin: org.apache.activemq/activemq-http
httpMethod.addHeader("Content-Type", "application/x-gzip");
if (LOG.isTraceEnabled()) {
LOG.trace("Sending compressed, size = " + bytes.length + ", compressed size = " + bytesOut.size());
代码示例来源:origin: pierre/meteo
private String readLine(DataInput in, int maxLength, String errorMessage) throws IOException {
byte b;
ByteArrayOutputStream baos = new ByteArrayOutputStream(maxLength);
while ((b = in.readByte()) != '\n') {
if (baos.size() > maxLength) {
throw new ProtocolException(errorMessage, true);
}
baos.write(b);
}
baos.close();
ByteSequence sequence = baos.toByteSequence();
return new String(sequence.getData(), sequence.getOffset(), sequence.getLength(), "UTF-8");
}
代码示例来源:origin: org.apache.activemq/activemq-all
private ByteSequence readHeaderLine(DataInput in, int maxLength, String errorMessage) throws IOException {
byte b;
ByteArrayOutputStream baos = new ByteArrayOutputStream(maxLength);
while ((b = in.readByte()) != '\n') {
if (baos.size() > maxLength) {
baos.close();
throw new ProtocolException(errorMessage, true);
}
baos.write(b);
}
baos.close();
ByteSequence line = baos.toByteSequence();
if (stompVersion.equals(Stomp.V1_0) || stompVersion.equals(Stomp.V1_2)) {
int lineLength = line.getLength();
if (lineLength > 0 && line.data[lineLength-1] == '\r') {
line.setLength(lineLength-1);
}
}
return line;
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
private ByteSequence readHeaderLine(DataInput in, int maxLength, String errorMessage) throws IOException {
byte b;
ByteArrayOutputStream baos = new ByteArrayOutputStream(maxLength);
while ((b = in.readByte()) != '\n') {
if (baos.size() > maxLength) {
baos.close();
throw new ProtocolException(errorMessage, true);
}
baos.write(b);
}
baos.close();
ByteSequence line = baos.toByteSequence();
if (stompVersion.equals(Stomp.V1_0) || stompVersion.equals(Stomp.V1_2)) {
int lineLength = line.getLength();
if (lineLength > 0 && line.data[lineLength-1] == '\r') {
line.setLength(lineLength-1);
}
}
return line;
}
代码示例来源:origin: org.apache.activemq/activemq-stomp
private ByteSequence readHeaderLine(DataInput in, int maxLength, String errorMessage) throws IOException {
byte b;
ByteArrayOutputStream baos = new ByteArrayOutputStream(maxLength);
while ((b = in.readByte()) != '\n') {
if (baos.size() > maxLength) {
baos.close();
throw new ProtocolException(errorMessage, true);
}
baos.write(b);
}
baos.close();
ByteSequence line = baos.toByteSequence();
if (stompVersion.equals(Stomp.V1_0) || stompVersion.equals(Stomp.V1_2)) {
int lineLength = line.getLength();
if (lineLength > 0 && line.data[lineLength-1] == '\r') {
line.setLength(lineLength-1);
}
}
return line;
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
private ByteSequence readHeaderLine(DataInput in, int maxLength, String errorMessage) throws IOException {
byte b;
ByteArrayOutputStream baos = new ByteArrayOutputStream(maxLength);
while ((b = in.readByte()) != '\n') {
if (baos.size() > maxLength) {
baos.close();
throw new ProtocolException(errorMessage, true);
}
baos.write(b);
}
baos.close();
ByteSequence line = baos.toByteSequence();
if (stompVersion.equals(Stomp.V1_0) || stompVersion.equals(Stomp.V1_2)) {
int lineLength = line.getLength();
if (lineLength > 0 && line.data[lineLength - 1] == '\r') {
line.setLength(lineLength - 1);
}
}
return line;
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
private ByteSequence readHeaderLine(DataInput in, int maxLength, String errorMessage) throws IOException {
byte b;
ByteArrayOutputStream baos = new ByteArrayOutputStream(maxLength);
while ((b = in.readByte()) != '\n') {
if (baos.size() > maxLength) {
baos.close();
throw new ProtocolException(errorMessage, true);
}
baos.write(b);
}
baos.close();
ByteSequence line = baos.toByteSequence();
if (stompVersion.equals(Stomp.V1_0) || stompVersion.equals(Stomp.V1_2)) {
int lineLength = line.getLength();
if (lineLength > 0 && line.data[lineLength - 1] == '\r') {
line.setLength(lineLength - 1);
}
}
return line;
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
} else if (baos.size() > MAX_DATA_LENGTH) {
throw new ProtocolException("The maximum data length was exceeded", true);
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
} else if (baos.size() > MAX_DATA_LENGTH) {
throw new ProtocolException("The maximum data length was exceeded", true);
代码示例来源:origin: org.apache.activemq/activemq-all
if (baos == null) {
baos = new ByteArrayOutputStream();
} else if (baos.size() > getMaxDataLength()) {
throw new ProtocolException("The maximum data length was exceeded", true);
} else {
代码示例来源:origin: org.apache.activemq/activemq-stomp
if (baos == null) {
baos = new ByteArrayOutputStream();
} else if (baos.size() > getMaxDataLength()) {
throw new ProtocolException("The maximum data length was exceeded", true);
} else {
代码示例来源:origin: pierre/meteo
} else if (baos.size() > MAX_DATA_LENGTH) {
throw new ProtocolException("The maximum data length was exceeded", true);
内容来源于网络,如有侵权,请联系作者删除!