- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.jcraft.jzlib.ZOutputStream
类的一些代码示例,展示了ZOutputStream
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZOutputStream
类的具体详情如下:
包路径:com.jcraft.jzlib.ZOutputStream
类名称:ZOutputStream
[英]ZOutputStream
[中]佐普特溪
代码示例来源:origin: igniterealtime/Openfire
@Override
public void startCompression() {
compressed = true;
try {
if (tlsStreamHandler == null) {
ZOutputStream out = new ZOutputStream(
ServerTrafficCounter.wrapOutputStream(socket.getOutputStream()),
JZlib.Z_BEST_COMPRESSION);
out.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
xmlSerializer = new XMLSocketWriter(writer, this);
}
else {
ZOutputStream out = new ZOutputStream(tlsStreamHandler.getOutputStream(), JZlib.Z_BEST_COMPRESSION);
out.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
xmlSerializer = new XMLSocketWriter(writer, this);
}
} catch (IOException e) {
// TODO Would be nice to still be able to throw the exception and not catch it here
Log.error("Error while starting compression", e);
compressed = false;
}
}
代码示例来源:origin: aurorafeint/jruby-memcached
if (getFlags() == COMPRESS_FLAG) {
ByteArrayOutputStream out2 = new ByteArrayOutputStream();
zout = new ZOutputStream(out2, JZlib.Z_DEFAULT_COMPRESSION);
zout.write(out1.toByteArray());
zout.flush();
zout.end();
bytes = out2.toByteArray();
} else {
if (zout != null) {
try {
zout.close();
} catch (IOException e) {}
zout = null;
代码示例来源:origin: google/sagetv
public void close() throws IOException {
try{
try{finish();}
catch (IOException ignored) {}
}
finally{
end();
out.close();
out=null;
}
}
代码示例来源:origin: com.jcraft/jzlib
public void finish() throws IOException {
int err;
if(compress){
int tmp = flush;
int flush = JZlib.Z_FINISH;
try{
write("".getBytes(), 0, 0);
}
finally { flush = tmp; }
}
else{
dos.finish();
}
flush();
}
public synchronized void end() {
代码示例来源:origin: com.jcraft/jzlib
public void write(int b) throws IOException {
buf1[0]=(byte)b;
write(buf1, 0, 1);
}
代码示例来源:origin: org.motechproject/motech-mobileforms-api
@RequestMapping(value = "/download", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
public void downloadHandler(HttpServletRequest request, HttpServletResponse response) throws IOException {
ZOutputStream zOutput = new ZOutputStream(response.getOutputStream(), JZlib.Z_BEST_COMPRESSION);
DataInputStream dataInput = new DataInputStream(request.getInputStream());
DataOutputStream dataOutput = new DataOutputStream(zOutput);
try {
readParameters(dataInput);
byte action = readActionByte(dataInput);
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
if (action == ACTION_DOWNLOAD_STUDY_LIST) {
handleDownloadStudies(byteStream);
} else if (action == ACTION_DOWNLOAD_USERS_AND_FORMS) {
handleDownloadUsersAndForms(byteStream, dataInput);
}
dataOutput.writeByte(RESPONSE_SUCCESS);
dataOutput.write(byteStream.toByteArray());
log.info("successfully downloaded the xforms");
} catch (Exception e) {
dataOutput.writeByte(RESPONSE_ERROR);
throw new SerializationFailedException(FAILED_TO_SERIALIZE_DATA, e);
} finally {
dataOutput.close();
response.flushBuffer();
}
}
代码示例来源:origin: com.jcraft.jzlib/com.springsource.com.jcraft.jzlib
public void finish() throws IOException {
int err;
do{
z.next_out=buf;
z.next_out_index=0;
z.avail_out=bufsize;
if(compress){ err=z.deflate(JZlib.Z_FINISH); }
else{ err=z.inflate(JZlib.Z_FINISH); }
if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK)
throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
if(bufsize-z.avail_out>0){
out.write(buf, 0, bufsize-z.avail_out);
}
}
while(z.avail_in>0 || z.avail_out==0);
flush();
}
public void end() {
代码示例来源:origin: com.jcraft/jzlib
public void close() throws IOException {
try{
try{finish();}
catch (IOException ignored) {}
}
finally{
end();
out.close();
out=null;
}
}
代码示例来源:origin: google/sagetv
protected void sendBufferNow() throws java.io.IOException
{
if (sockBuf.position() == 0) return;
sockBuf.flip();
if (zout != null)
{
zout.write(sockBuf.array(), 0, sockBuf.limit());
zout.flush();
}
else
{
while (clientSocket != null && sockBuf.hasRemaining())
clientSocket.write(sockBuf);
}
sockBuf.clear();
}
代码示例来源:origin: google/sagetv
public void write(int b) throws IOException {
buf1[0]=(byte)b;
write(buf1, 0, 1);
}
代码示例来源:origin: org.motechproject/motech-mobileforms-api
@RequestMapping(value = "/upload", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.OK)
public void uploadHandler(HttpServletRequest request, HttpServletResponse response) throws IOException {
ZOutputStream zOutput = new ZOutputStream(response.getOutputStream(), JZlib.Z_BEST_COMPRESSION);
DataInputStream dataInput = new DataInputStream(request.getInputStream());
DataOutputStream dataOutput = new DataOutputStream(zOutput);
代码示例来源:origin: google/sagetv
public void finish() throws IOException {
int err;
do{
z.next_out=buf;
z.next_out_index=0;
z.avail_out=bufsize;
if(compress){ err=z.deflate(JZlib.Z_FINISH); }
else{ err=z.inflate(JZlib.Z_FINISH); }
if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK)
throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
if(bufsize-z.avail_out>0){
out.write(buf, 0, bufsize-z.avail_out);
}
}
while(z.avail_in>0 || z.avail_out==0);
flush();
}
public void end() {
代码示例来源:origin: k9mail/k-9
private void enableCompression(Socket socket) throws IOException {
InputStream inputStream = new InflaterInputStream(socket.getInputStream(), new Inflater(true));
input = Okio.buffer(Okio.source(inputStream));
ZOutputStream outputStream = new ZOutputStream(socket.getOutputStream(), JZlib.Z_BEST_SPEED, true);
outputStream.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
output = Okio.buffer(Okio.sink(outputStream));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jzlib
public void close() throws IOException {
try{
try{finish();}
catch (IOException ignored) {}
}
finally{
end();
out.close();
out=null;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jzlib
public void finish() throws IOException {
int err;
if(compress){
int tmp = flush;
int flush = JZlib.Z_FINISH;
try{
write("".getBytes(), 0, 0);
}
finally { flush = tmp; }
}
else{
dos.finish();
}
flush();
}
public synchronized void end() {
代码示例来源:origin: com.jcraft.jzlib/com.springsource.com.jcraft.jzlib
public void write(int b) throws IOException {
buf1[0]=(byte)b;
write(buf1, 0, 1);
}
代码示例来源:origin: jzlib/jzlib
public void finish() throws IOException {
int err;
do{
z.next_out=buf;
z.next_out_index=0;
z.avail_out=bufsize;
if(compress){ err=z.deflate(JZlib.Z_FINISH); }
else{ err=z.inflate(JZlib.Z_FINISH); }
if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK)
throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
if(bufsize-z.avail_out>0){
out.write(buf, 0, bufsize-z.avail_out);
}
}
while(z.avail_in>0 || z.avail_out==0);
try { flush(); }
catch (IOException ignored) {
}
}
public void end() throws IOException {
代码示例来源:origin: k9mail/k-9
private void enableCompression(Socket socket) throws IOException {
InputStream inputStream = new InflaterInputStream(socket.getInputStream(), new Inflater(true));
input = Okio.buffer(Okio.source(inputStream));
ZOutputStream outputStream = new ZOutputStream(socket.getOutputStream(), JZlib.Z_BEST_SPEED, true);
outputStream.setFlushMode(JZlib.Z_PARTIAL_FLUSH);
output = Okio.buffer(Okio.sink(outputStream));
}
代码示例来源:origin: ymnk/jzlib
public void close() throws IOException {
try{
try{finish();}
catch (IOException ignored) {}
}
finally{
end();
out.close();
out=null;
}
}
代码示例来源:origin: ymnk/jzlib
public void finish() throws IOException {
int err;
if(compress){
int tmp = flush;
int flush = JZlib.Z_FINISH;
try{
write("".getBytes(), 0, 0);
}
finally { flush = tmp; }
}
else{
dos.finish();
}
flush();
}
public synchronized void end() {
本文整理了Java中com.jcraft.jzlib.ZOutputStream.write()方法的一些代码示例,展示了ZOutputStream.write()的具体用法。这些代码示例主要来源于G
本文整理了Java中com.jcraft.jzlib.ZOutputStream.setFlushMode()方法的一些代码示例,展示了ZOutputStream.setFlushMode()的具体用
本文整理了Java中com.jcraft.jzlib.ZOutputStream.()方法的一些代码示例,展示了ZOutputStream.()的具体用法。这些代码示例主要来源于Github/Stac
本文整理了Java中com.jcraft.jzlib.ZOutputStream.finish()方法的一些代码示例,展示了ZOutputStream.finish()的具体用法。这些代码示例主要来源
本文整理了Java中com.jcraft.jzlib.ZOutputStream.flush()方法的一些代码示例,展示了ZOutputStream.flush()的具体用法。这些代码示例主要来源于G
本文整理了Java中com.jcraft.jzlib.ZOutputStream.end()方法的一些代码示例,展示了ZOutputStream.end()的具体用法。这些代码示例主要来源于Githu
我有一个简单的测试用例,在 jzlib 中产生肯定的 ArrayOutOfBoundException1.0.7 取决于随后写入同一个实例的数据ZOutputStream 的。 堆栈跟踪: java.
我是一名优秀的程序员,十分优秀!