  id="defs3292">
  <inkscape:perspective xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:vp_x="0 : 14.85 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="81 : 14.85 : 1" sodipodi:type="inkscape:persp3d" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" id="perspective3296" inkscape:persp3d-origin="40.5 : 9.9000003 : 1"/>
 </defs>
 <sodipodi:namedview xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" objecttolerance="10" inkscape:cx="40.5" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:pageshadow="2" inkscape:window-height="488" inkscape:cy="14.85" bordercolor="#666666" id="namedview3290" guidetolerance="10" inkscape:pageopacity="0" inkscape:window-x="0" inkscape:window-y="0" inkscape:current-layer="breadboard" pagecolor="#ffffff" showgrid="false" inkscape:zoom="6.6666667" inkscape:window-width="640" borderopacity="1" inkscape:window-maximized="0" gridtolerance="10"/>
 <g  id="breadboard">
  <rect  width="90.0" x="0" y="3" fill="#303030" height="27.0" id="middle"/>
  <rect  width="90.0" x="0" y="3.0" fill="#3D3D3D" height="2.46" id="top"/>
  <rect  width="90.0" x="0" y="27.54" fill="#000000" height="2.46" id="bottom"/>
  <polygon  fill="#141414" points="90.0,3 89.25,5.46 89.25,27.54 90.0,30.0" id="right"/>
  <polygon  fill="#1F1F1F" points="0,3 0.75,5.46 0.75,27.54 0,30.0" id="left"/>
  <polygon  fill="#1C1C1C" points="5,11.5 0.75,11.46 0.56,13.58 0.56,16.5 5,16.5" id="left-upper-rect"/>
  <polygon  fill="#383838" points="0.75,21.55 5,21.55 5,16.5 0.56,16.5 0.56,19.42" id="left-lower-rect"/>
  <path  fill="#262626" id="slot" d="M0.56,13.58v5.83c1.47-0.17,2.62-1.4,2.62-2.92C3.18,14.97,2.04,13.75,0.56,13.58z"/>
  <path  fill="#303030" id="cover" d="M0.75,5.46V11.45c2.38,0.45,4.19,2.53,4.19,5.04c0,2.51-1.8,4.6-4.19,5.05V21.55h5.0V5.46H0.75z"/>
  <circle  fill="#212121" cx="6.5" cy="23.47" r="2.06" id="circle3215"/>
  <g fill="#e6e6e6" font-family="OCRA" sodipodi:linespacing="125%" text-anchor="start" stroke="none" style="text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" id="label" font-size="8">
   <text x="6.5" y="16.5">PICAXE-18A</text>
  </g>
  <rect  width="3" x="3.5" y="28.66" fill="#8C8C8C" height="4.34" id="connector0pin"/>
  <rect  width="3" x="3.5" y="30.0" fill="#8C8C8C" height="3" id="connector0terminal"/>
  <polygon  fill="#8C8C8C" points="3.5,28.66 3.5,30.66 6.5,30.66 8.5,29.74 8.5,28.66  " id="polygon3220"/>
  <rect  width="3" x="3.5" fill="#8C8C8C" height="4.34" id="connector17pin"/>
  <rect  width="3" x="3.5" fill="#8C8C8C" height="3" id="connector17terminal"/>
  <polygon  fill="#8C8C8C" points="8.5,4.34 8.5,3.26 6.5,2.34 3.5,2.34 3.5,4.34" id="polygon3224"/>
  <rect  width="3" x="83.5" y="28.66" fill="#8C8C8C" height="4.34" id="connector8pin"/>
  <rect  width="3" x="83.5" y="30.0" fill="#8C8C8C" height="3" id="connector8terminal"/>
  <polygon  fill="#8C8C8C" points="81.5,28.66 81.5,29.74 83.5,30.66 86.5,30.66 86.5,28.66" id="polygon3228"/>
  <rect  width="3" x="83.5" y="0" fill="#8C8C8C" height="4.34" id="/*
 * Copyright 2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.gradle.internal.serialize.kryo;

import com.esotericsoftware.kryo.io.Output;
import org.gradle.api.Nullable;
import org.gradle.internal.serialize.AbstractEncoder;
import org.gradle.internal.serialize.FlushableEncoder;

import java.io.Closeable;
import java.io.OutputStream;

public class KryoBackedEncoder extends AbstractEncoder implements FlushableEncoder, Closeable {
    private final Output output;

    public KryoBackedEncoder(OutputStream outputStream) {
        this(outputStream, 4096);
    }

    public KryoBackedEncoder(OutputStream outputStream, int bufferSize) {
        output = new Output(outputStream, bufferSize);
    }

    public void writeByte(byte value) {
        output.writeByte(value);
    }

    public void writeBytes(byte[] bytes, int offset, int count) {
        output.writeBytes(bytes, offset, count);
    }

    public void writeLong(long value) {
        output.writeLong(value);
    }

    public void writeSmallLong(long value) {
        output.writeLong(value, true);
    }

    public void writeInt(int value) {
        output.writeInt(value);
    }

    public void writeSmallInt(int value) {
        output.writeInt(value, true);
    }

    public void writeBoolean(boolean value) {
        output.writeBoolean(value);
    }

    public void writeString(CharSequence value) {
        if (value == null) {
            throw new IllegalArgumentException("Cannot encode a null string.");
        }
        output.writeString(value);
    }

    public void writeNullableString(@Nullable CharSequence value) {
        output.writeString(value);
    }

    /**
     * Returns the total number of bytes written by this encoder, some of which is may still be buffered.
     */
    public int getWritePosition() {
        return output.total();
    }

    public void flush() {
        output.flush();
    }

    public void close() {
        output.close();
    }
}
