Package java.io

Examples of java.io.InputStream.markSupported()


                    signaturePartDef.setDigestAlgo(getSecurityProperties().getSignatureDigestAlgorithm());
                }

                DigestOutputStream digestOutputStream = createMessageDigestOutputStream(signaturePartDef.getDigestAlgo());
                InputStream inputStream = attachment.getSourceStream();
                if (!inputStream.markSupported()) {
                    inputStream = new BufferedInputStream(inputStream);
                }
                inputStream.mark(Integer.MAX_VALUE); //we can process at maximum 2G with the standard jdk streams

                try {
View Full Code Here


        //read bytes from input stream to check if
        //attachment size is greater than the optimized size.       
        int totalRead = 0;
        try{
            in = getInputStream(dh);
            if(in.markSupported()){
                in.mark((int)limit);
            }
            if(in == null){
                if(log.isDebugEnabled()){
                    log.debug("Input Stream is null");
View Full Code Here

                int bytesRead = in.read(buffer, 0, BUFFER_LEN);
                totalRead = totalRead+bytesRead;
                releaseTempBuffer(buffer);
            }while((limit>totalRead) && (in.available()>0));
           
            if(in.markSupported()){               
                in.reset();
            }
            if(totalRead > limit){
                if(log.isDebugEnabled()){
                    log.debug("Attachment size greater than limit");
View Full Code Here

            DataSource ds = dataHandler.getDataSource();
            if(ds instanceof FileDataSource){
                inStream = ds.getInputStream();
            }else{
                inStream = dataHandler.getDataSource().getInputStream();
                if(!inStream.markSupported()){
                    throw new OMException("Stream does not support mark, Cannot read the stream as DataSource will be consumed.");
                }
            }
        } catch (IOException e) {
            throw new OMException(
View Full Code Here

    if (!annot.required()) {
      InputStream inputStream = inputMessage.getBody();
      if (inputStream == null) {
        return null;
      }
      else if (inputStream.markSupported()) {
        inputStream.mark(1);
        if (inputStream.read() == -1) {
          return null;
        }
        inputStream.reset();
View Full Code Here

        if ((this.maxSize > -1) && (this.contentLength > this.maxSize)) {
            this.maxLengthExceeded = true;
        } else {
            InputStream requestInputStream = this.request.getInputStream();
            // mark the input stream to allow multiple reads
            if (requestInputStream.markSupported()) {
                requestInputStream.mark(contentLength + 1);
            }
            this.inputStream.setBoundary(this.boundary);
            this.inputStream.setInputStream(requestInputStream);
        }
View Full Code Here

    }

    @Override
    public boolean markSupported() {
      InputStream in = getInputStream();
      return in != null && in.markSupported();
    }

    @Override
    public void mark(int readlimit) {
      InputStream in = getInputStream();
View Full Code Here

             URL absoluteURL = absoluteURI.toURL();
             URLConnection connection = absoluteURL.openConnection();
             connection.connect();
             is = connection.getInputStream();

             if (!is.markSupported()) {
                 is = new BufferedInputStream(is);
             }

             // Get any external (HTTP) encoding label.
             String contentType;
View Full Code Here

            hdrInfo = new HeaderInfo(hdrLen, valueLength);
            // Make sure the stream is correctly positioned.
            rewindStream((InputStream)in, hdrLen);
        } else {
            final InputStream srcIn = (InputStream)in;
            final boolean markSet = srcIn.markSupported();
            if (markSet) {
                srcIn.mark(MAX_STREAM_HEADER_LENGTH);
            }
            byte[] header = new byte[MAX_STREAM_HEADER_LENGTH];
            int read = in.read(header);
View Full Code Here

      {
          SanityManager.THROWASSERT("NDRDAType: " + ndrdaType +
                  " not valid EXTDTA object type");
      }
    }
  if (! is.markSupported()) {
      is = new BufferedInputStream(is);
      }
     
   this.binaryInputStream=is;
    }
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.