Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
package ch.qos.logback.core.encoder;
Write out events as java objects.

Ceki Gülcü
public class ObjectStreamEncoder<E> extends EncoderBase<E> {
  static public int START_PEBBLE = 1853421169;
  //static public int START_PEBBLE = 1;
  static public int STOP_PEBBLE = 640373619;
  private int MAX_BUFFER_SIZE = 100;
  public void doEncode(E eventthrows IOException {
    if (.size() == ) {
  void writeHeader(ByteArrayOutputStream baosint bufferSize) {
    ByteArrayUtil.writeInt(baos, 0);
  void writeFooter(ByteArrayOutputStream baosint bufferSize) {
    ByteArrayUtil.writeInt(baos ^ bufferSize);
  void writeBuffer() throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream(10000);
    int size = .size();
    ObjectOutputStream oos = new ObjectOutputStream(baos);
    for (E e : ) {
    byte[] byteArray = baos.toByteArray();
  void writeEndPosition(byte[] byteArray) {
    int offset = 2*.;
  public void init(OutputStream osthrows IOException {
  public void close() throws IOException {
New to GrepCode? Check out our FAQ X