Write a Structure object to an {@link OutputStream}
@param structure the Structure to write
@param outputStream the {@link OutputStream} to write to
@throws IOException an error transferring the byte[]
198434
public static void writeToOutputStream(Structure structure, OutputStream outputStream) throws IOException{
		// Set up this writer
		AdapterToStructureData writerToEncoder = new AdapterToStructureData();
		// Get the writer - this is what people implement
		new MmtfStructureWriter(structure, writerToEncoder);
		// Now write this data to file
		byte[] outputBytes = WriterUtils.getDataAsByteArr(writerToEncoder);
		outputStream.write(outputBytes,0,outputBytes.length);
	}
103736
void writeToStream(DataOutput out) throws IOException {

        int n = this.strategies.size();
        out.writeInt(n);

        if (n == 0) {
            out.writeUTF(this.lastRule.name());
            out.writeInt(this.lastAnnoDomini);
            return;
        }

        for (int i = 0; i < n; i++) {
            NewYearStrategy strategy = this.strategies.get(i);
            out.writeUTF(strategy.lastRule.name());
            out.writeInt(strategy.lastAnnoDomini);
        }

    }
780027
public static void serialize(Object value, OutputStream outputStream) throws IOException {
    try {
      new ObjectOutputStream(outputStream).writeObject(value);
    } finally {
      outputStream.close();
    }
  }
650180
public static void writeJson(@javax.annotation.Nonnull final OutputStream out, final Object obj) throws IOException {
    final ObjectMapper mapper = new ObjectMapper().enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL)
      .enable(SerializationFeature.INDENT_OUTPUT);
    @javax.annotation.Nonnull final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    mapper.writeValue(buffer, obj);
    out.write(buffer.toByteArray());
  }
549818
@SuppressWarnings("unused")
	private void genDirStructure() throws IOException {
		BufferedReader in = new BufferedReader(new FileReader(new File(inDir,
				StructureGenerator.DIR_STRUCTURE_FILE_NAME)));
		String line;
		while ((line = in.readLine()) != null) {
			fs.mkdirs(new Path(root + line));
		}
	}
617665
@Override
  public void write (@Nonnull final byte [] b) throws IOException
  {
    checkThreshold (b.length);
    getStream ().write (b);
    m_nWritten += b.length;
  }
384633
public static void copy(InputStream inputStream, OutputStream outputStream, byte[] buffer) throws IOException {
    LOGGER.trace("copy(InputStream, OutputStream, byte[])");
    copy(inputStream, outputStream, buffer, null);
  }
212251
@Override
    public void write(final OutputStream out, final Buffer payload) throws IOException {
        this.getParentPacket().write(out, Buffers.wrap(this.msg.toBuffer(), payload));
    }
1194715
public void write(final OutputStream out) throws IOException {
        if (this.byteOrder == ByteOrder.BIG_ENDIAN) {
            out.write(MAGIC_BIG_ENDIAN);
        } else {
            out.write(MAGIC_LITTLE_ENDIAN);
        }
        out.write(this.body);
    }
54681
public static Structure readFromInputStream(InputStream inStream) throws IOException {
		// Get the reader - this is the bit that people need to implement.
		MmtfStructureReader mmtfStructureReader = new MmtfStructureReader();
		// Do the inflation
		new StructureDataToAdapter(new GenericDecoder(ReaderUtils.getDataFromInputStream(inStream)), mmtfStructureReader);
		// Get the structue
		return mmtfStructureReader.getStructure();
	}
116489
public static void writeObjects(OutputStream out, boolean isCloseOut, Serializable... contents) throws IORuntimeException {
		ObjectOutputStream osw = null;
		try {
			osw = out instanceof ObjectOutputStream ? (ObjectOutputStream) out : new ObjectOutputStream(out);
			for (Object content : contents) {
				if (content != null) {
					osw.writeObject(content);
					osw.flush();
				}
			}
		} catch (IOException e) {
			throw new IORuntimeException(e);
		} finally {
			if (isCloseOut) {
				close(osw);
			}
		}
	}
324978
public void write(OutputStream out) throws IOException
    {
        if (log.isTraceEnabled())
            log.trace("AJP13 snd: "+this.toString(64));
        // System.err.println(Thread.currentThread()+" AJP13 snd
        // "+this.toString());
        out.write(_buf,0,_bytes);
    }
28498
@Override
  public void write(byte[] b, int off, int len) throws IOException {
    for (OutputStream child : children) {
      child.write(b, off, len);
    }
  }
601350
@Override
    public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException {
	try {
	    out.writeObject(new HashMap(this));
	}
	catch (NotSerializableException nse) {
	    NotSerializableException tmp = new NotSerializableException(nse.getMessage() + ":" + entries());
	    tmp.initCause(nse);
	    throw tmp;
	}
    }
781148
public void writeContent(final OutputStream out) throws IOException
    {
    	final byte[] contentBytes = DocWriter.getISOBytes(this.directContent);
   		out.write(contentBytes);
    }
869903
public void writeTo(OutputStream out) throws IOException {
        out.write(this.content);
        out.flush();
        out.close();
    }
812106
@Override
    public void writeExternal(ObjectOutput output) throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Serializing: " + this);
        }
        super.writeExternal(output);
        // write out the byte[] to avoid hardcoding impl information (ordinals)
        writeByteArray(output, getMethodValue().getByteArray());
        writeByteArray(output, getSchemeValue().getByteArray());

        writeByteArray(output, getRequestURIAsByteArray());
        writeByteArray(output, getQueryStringAsByteArray());
    }