Package com.alibaba.citrus.util.io

Examples of com.alibaba.citrus.util.io.ByteArrayOutputStream.toByteArray()


                    }

                    def.end();
                }

                byte[] plaintext = baos.toByteArray().toByteArray();

                // 3. base64编码
                return StringEscapeUtil.escapeURL(new String(Base64.encodeBase64(plaintext, false), "ISO-8859-1"));
            } catch (Exception e) {
                log.error("Failed to encode field attachment", e);
View Full Code Here


            dos.writeLong(jvmId);
            dos.writeLong(random);
        } catch (Exception e) {
        }

        return baos.toByteArray().toByteArray();
    }

    public String nextID() {
        // MACHINE_ID + JVM_ID + 当前时间 + counter
        return instanceId + "-" + StringUtil.longToString(System.currentTimeMillis(), noCase) + "-"
View Full Code Here

            ((BufferedServletOutputStream) stream).updateOutputStream(bytesStack.peek());

            log.debug("Popped the last byte buffer (stack size is " + bytesStack.size() + ")");

            return block.toByteArray();
        }
    }

    /**
     * 弹出最近的buffer,如果堆栈中只有一个buffer,则弹出后再创建一个新的。
 
View Full Code Here

            dos.writeLong(jvmId);
            dos.writeLong(random);
        } catch (Exception e) {
        }

        return baos.toByteArray().toByteArray();
    }

    public String nextID() {
        // MACHINE_ID + JVM_ID + ��ǰʱ�� + counter
        return instanceId + "-" + StringUtil.longToString(System.currentTimeMillis(), noCase) + "-"
View Full Code Here

            }

            def.end();
        }

        byte[] plaintext = baos.toByteArray().toByteArray();

        // 3. ����
        byte[] cryptotext = encrypt(plaintext);

        // 4. base64����
View Full Code Here

                    }

                    def.end();
                }

                byte[] plaintext = baos.toByteArray().toByteArray();

                // 3. base64����
                return StringEscapeUtil.escapeURL(new String(Base64.encodeBase64(plaintext, false), "ISO-8859-1"));
            } catch (Exception e) {
                log.error("Failed to encode field attachment", e);
View Full Code Here

            unexpectedException(e);
        } finally {
            ostream.close();
        }

        ByteArray bytes = ostream.toByteArray();

        javaCharset = getJavaCharset(javaCharset);

        return new String(bytes.getRawBytes(), bytes.getOffset(), bytes.getLength(), javaCharset);
    }
View Full Code Here

            ((BufferedServletOutputStream) stream).updateOutputStream(bytesStack.peek());

            log.debug("Popped the last byte buffer (stack size is " + bytesStack.size() + ")");

            return block.toByteArray();
        }
    }

    /**
     * ���������buffer�������ջ��ֻ��һ��buffer���򵯳����ٴ���һ���µġ�
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.