Package java.io

Examples of java.io.ByteArrayOutputStream.toByteArray()


        "de;GMT+01:00;EUROSPORT;Eurosport;(c) by Eurosport;;;0;\"Eurosport\"\n" +
        "de;GMT+01:00;AXN;AXN;(c) by AXN;http://www.axntv.de;;273;\"AXN\"\n" +
        "de;GMT+01:00;DMAXPUNNY;DMAX PUNNY;(c) by DMAX;http://www.dmaxtv.de/;http://sender.wannawork.de/logos/DMAX.png;257;\"Wöhnungssüche\"\n" +
        "de;GMT+01:00;EUROSPORTPUNNY;Eurosport PUNNY;(c) by Eurosport;;;0;\"Küchendißteln\"\n" +
        "de;GMT+01:00;AXNPUNNY;AXN PUNNY;(c) by AXN;http://www.axntv.de;;273;\"Älbert 獠\"",
        toString(new GZIPInputStream(new ByteArrayInputStream(stream.toByteArray()))));
  }


  /**
   * Writes the content of the input stream to a <code>String<code>.
View Full Code Here


              if (x <= 0) {
                  break;
              }
              buff.write(x);
          }
          return new String(buff.toByteArray(), this.encoding);
      }
  }
 
  private static void trace(Object... msg) {
    LogManager.logTrace(LogConstants.CTX_ODBC, msg);
View Full Code Here

            // serialize and create an input stream to read WSDL
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            try {
                if (trace()) trace.info("Serializing wsdlElement found to build an Axis2 service");
                wsdlElement.serialize(baos);
                wsdlInputStream = new ByteArrayInputStream(baos.toByteArray());
            } catch (XMLStreamException e) {
                handleException("Error converting to a StreamSource", e);
            }

            if (wsdlInputStream != null) {
View Full Code Here

      }
    } catch (IOException e) {
      throw new IllegalStateException("Error reading stream.", e);
    }   
   
    return outBuffer.toByteArray();
  }
}
View Full Code Here

                }

                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                try {
                    MessageHelper.cloneSOAPEnvelope(synCtx.getEnvelope()).serialize(outStream);
                    cachedObj.setResponseEnvelope(outStream.toByteArray());
                } catch (XMLStreamException e) {
                    handleException("Unable to set the response to the Cache", e, synCtx);
                }

                /* this is not required yet, can commented this for perf improvements
View Full Code Here

            dos.writeInt(nCapture);
            dos.writeInt(this.nCurrentHeight);
            dos.writeInt(this.nCurrentWidth);
            dos.flush();
            baos.flush();
            byte[] bRes = baos.toByteArray();
            dos = null;
            baos = null;
            rs.addRecord(bRes, 0, bRes.length);
            bRes = null;
            rs.closeRecordStore();
View Full Code Here

            DataOutputStream out=new DataOutputStream(out_stream);
            try {
                if(obj == null) {
                    out_stream.write(NULL);
                    out_stream.flush();
                    return out_stream.toByteArray();
                }
                if(obj instanceof MethodCall) {
                    out.writeByte(METHOD_CALL);
                    MethodCall call=(MethodCall)obj;
                    out.writeShort(call.getId());
View Full Code Here

                else {
                    out.writeByte(OBJ);
                    Util.objectToStream(obj, out);
                }
                out.flush();
                return out_stream.toByteArray();
            }
            finally {
                Util.close(out);
            }
        }
View Full Code Here

                   boolean first) throws IOException {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.writeObject(obj);
    oos.flush();
    saveByteArray(bos.toByteArray(), dirName, name);
  }

  public final void createByteArray(byte[] buf, String name) throws IOException {
    saveByteArray(buf, null, name, true, true);
  }
View Full Code Here

            bSource = null;
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            DataOutputStream dos = new DataOutputStream(baos);
            dos.flush();
            baos.flush();
            byte[] bRes = baos.toByteArray();
            dos = null;
            baos = null;
            setRecord(rs, this.nIdSettings, bRes);
            bRes = null;
            rs.closeRecordStore();
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.