/// <summary> /// Synonym for opening the given resource and calling /// <see cref="decodeResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, Rect, Options) /// ">decodeResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, Rect, Options) /// </see> /// . /// </summary> /// <param name="res">The resources object containing the image data</param> /// <param name="id">The resource id of the image data</param> /// <param name="opts"> /// null-ok; Options that control downsampling and whether the /// image should be completely decoded, or just is size returned. /// </param> /// <returns> /// The decoded bitmap, or null if the image data could not be /// decoded, or, if opts is non-null, if opts requested only the /// size be returned (in opts.outWidth and opts.outHeight) /// </returns> public static android.graphics.Bitmap decodeResource(android.content.res.Resources res, int id, android.graphics.BitmapFactory.Options opts) { android.graphics.Bitmap bm = null; java.io.InputStream @is = null; try { android.util.TypedValue value = new android.util.TypedValue(); @is = res.openRawResource(id, value); bm = decodeResourceStream(res, value, @is, null, opts); } catch (System.Exception) { } finally { try { if (@is != null) { @is.close(); } } catch (System.IO.IOException) { } } // Ignore if (bm == null && opts != null && opts.inBitmap != null) { throw new System.ArgumentException("Problem decoding into existing bitmap"); } return(bm); }
/// <summary> /// Releases the unmanaged resources used by this /// <see cref="System.IO.Stream"/> and optionally /// releases the managed resources. /// </summary> /// <remarks> /// Calling this method with <c>true</c> effectively /// closes and nullifies this object's underlying /// java.io.InputStream. However, calling Close() /// is the preferred method. /// </remarks> /// <param name="disposing"> /// True to release both managed and unmanaged resources; /// false to release only unmanaged resources. /// </param> protected override void Dispose(bool disposing) { if (disposing) { lock (this) { try { if (m_in != null) { m_in.close(); } } catch (java.io.IOException ex) { throw new IOException(ex.ToString(), ex); } finally { m_in = null; base.Dispose(disposing); } } } else { base.Dispose(disposing); } }
public virtual ArangoDB.Builder loadProperties(java.io.InputStream @in ) { if (@in != null) { java.util.Properties properties = new java.util.Properties(); try { properties.load(@in); host = getProperty(properties, PROPERTY_KEY_HOST, host, ArangoDBConstants .DEFAULT_HOST); port = System.Convert.ToInt32(getProperty(properties, PROPERTY_KEY_PORT, port, ArangoDBConstants .DEFAULT_PORT)); timeout = System.Convert.ToInt32(getProperty(properties, PROPERTY_KEY_TIMEOUT, timeout , ArangoDBConstants.DEFAULT_TIMEOUT)); user = getProperty(properties, PROPERTY_KEY_USER, user, null); password = getProperty(properties, PROPERTY_KEY_PASSWORD, password, null); useSsl = bool.parseBoolean(getProperty(properties, PROPERTY_KEY_USE_SSL, useSsl, ArangoDBConstants.DEFAULT_USE_SSL)); chunksize = System.Convert.ToInt32(getProperty(properties, PROPERTY_KEY_V_STREAM_CHUNK_CONTENT_SIZE , chunksize, ArangoDBConstants.CHUNK_DEFAULT_CONTENT_SIZE )); } catch (System.IO.IOException e) { throw new ArangoDBException(e); } } return(this); }
static TextReader GetJavaTextReader(string filename) { try { java.lang.ClassLoader cl = (java.lang.ClassLoader) AppDomain.CurrentDomain.GetData("GH_ContextClassLoader"); if (cl == null) { return(null); } string custom = String.Concat("browscap/", filename); java.io.InputStream inputStream = cl.getResourceAsStream(custom); if (inputStream == null) { inputStream = cl.getResourceAsStream(filename); } if (inputStream == null) { return(null); } return(new StreamReader(new System.Web.J2EE.J2EEUtils.InputStreamWrapper(inputStream))); } catch (Exception e) { return(null); } }
/// <summary> /// Returns the ASCII characters up to but not including the next "\r\n", or /// "\n". /// </summary> /// <remarks> /// Returns the ASCII characters up to but not including the next "\r\n", or /// "\n". /// </remarks> /// <exception cref="java.io.EOFException"> /// if the stream is exhausted before the next newline /// character. /// </exception> /// <exception cref="System.IO.IOException"></exception> public static string readAsciiLine(java.io.InputStream @in) { // TODO: support UTF-8 here instead java.lang.StringBuilder result = new java.lang.StringBuilder(80); while (true) { int c = @in.read(); if (c == -1) { throw new java.io.EOFException(); } else { if (c == '\n') { break; } } result.append((char)c); } int length = result.Length; if (length > 0 && result[length - 1] == '\r') { result.setLength(length - 1); } return(result.ToString()); }
/// <summary> /// Reads exactly 'byteCount' bytes from 'in' (into 'dst' at offset 'offset'), and throws /// EOFException if insufficient bytes are available. /// </summary> /// <remarks> /// Reads exactly 'byteCount' bytes from 'in' (into 'dst' at offset 'offset'), and throws /// EOFException if insufficient bytes are available. /// Used to implement /// <see cref="java.io.DataInputStream.readFully(byte[], int, int)">java.io.DataInputStream.readFully(byte[], int, int) /// </see> /// . /// </remarks> /// <exception cref="System.IO.IOException"></exception> public static void readFully(java.io.InputStream @in, byte[] dst, int offset, int byteCount) { if (byteCount == 0) { return; } if (@in == null) { throw new System.ArgumentNullException("in == null"); } if (dst == null) { throw new System.ArgumentNullException("dst == null"); } java.util.Arrays.checkOffsetAndCount(dst.Length, offset, byteCount); while (byteCount > 0) { int bytesRead = @in.read(dst, offset, byteCount); if (bytesRead < 0) { throw new java.io.EOFException(); } offset += bytesRead; byteCount -= bytesRead; } }
/// <summary> /// Call /// <code>in.read()</code> /// repeatedly until either the stream is exhausted or /// <code>byteCount</code> /// bytes have been read. /// <p>This method reuses the skip buffer but is careful to never use it at /// the same time that another stream is using it. Otherwise streams that use /// the caller's buffer for consistency checks like CRC could be clobbered by /// other threads. A thread-local buffer is also insufficient because some /// streams may call other streams in their skip() method, also clobbering the /// buffer. /// </summary> /// <exception cref="System.IO.IOException"></exception> public static long skipByReading(java.io.InputStream @in, long byteCount) { // acquire the shared skip buffer. byte[] buffer = skipBuffer.getAndSet(null); if (buffer == null) { buffer = new byte[4096]; } long skipped = 0; while (skipped < byteCount) { int toRead = (int)System.Math.Min(byteCount - skipped, buffer.Length); int read = @in.read(buffer, 0, toRead); if (read == -1) { break; } skipped += read; if (read < toRead) { break; } } // release the shared skip buffer. skipBuffer.set(buffer); return(skipped); }
/// <summary>Implements InputStream.read(int) in terms of InputStream.read(byte[], int, int). /// </summary> /// <remarks> /// Implements InputStream.read(int) in terms of InputStream.read(byte[], int, int). /// InputStream assumes that you implement InputStream.read(int) and provides default /// implementations of the others, but often the opposite is more efficient. /// </remarks> /// <exception cref="System.IO.IOException"></exception> public static int readSingleByte(java.io.InputStream @in) { byte[] buffer = new byte[1]; int result = @in.read(buffer, 0, 1); return((result != -1) ? buffer[0] & unchecked ((int)(0xff)) : -1); }
/// <exception cref="System.IO.IOException"></exception> public static void skipAll(java.io.InputStream @in) { do { @in.skip(long.MaxValue); }while (@in.read() != -1); }
public static void CopyEntries(ZipFile from, ZipOutputStream to, FilterEntryMethod filter) { foreach (ZipEntry entry in new EnumerationAdapter(new EnumerationMethod(from.entries))) { if (filter == null || filter(entry)) { java.io.InputStream s = from.getInputStream(entry); try { to.putNextEntry(entry); try { CopyStream(s, to); } finally { to.closeEntry(); } } finally { s.close(); } } } }
public override int read() { lock (this) { // Use local refs since buf and in may be invalidated by an // unsynchronized close() byte[] localBuf = buf; java.io.InputStream localIn = @in; if (localBuf == null || localIn == null) { throw streamClosed(); } if (pos >= count && fillbuf(localIn, localBuf) == -1) { return(-1); } // localBuf may have been invalidated by fillbuf if (localBuf != buf) { localBuf = buf; if (localBuf == null) { throw streamClosed(); } } if (count - pos > 0) { return(localBuf[pos++] & unchecked ((int)(0xFF))); } return(-1); } }
/// <summary> /// Reads the zip stream. /// </summary> /// <param name="jInputStream">The j input stream.</param> /// <param name="callback">The callback.</param> /// <param name="rock">The rock.</param> public static void ReadZipStream(java.io.InputStream jInputStream, CallbackZip callback, object rock) { ZipInputStream zis = null; try { zis = new ZipInputStream(jInputStream); ZipEntry entry; ZipEntryE extendedEntry; while ((entry = zis.getNextEntry()) != null) { extendedEntry = new ZipEntryE(entry); callback(extendedEntry, new ZipEntryInputStream(zis), rock); // Close the entry that we read zis.closeEntry(); } } finally { if (zis != null) { zis.close(); } } }
public BitmapDrawable(java.io.InputStream @is) : this(new android.graphics.drawable.BitmapDrawable .BitmapState(android.graphics.BitmapFactory.decodeStream(@is)), null) { if (mBitmap == null) { android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + @is); } }
/// <summary> /// Constructs a new /// <code>BufferedInputStream</code> /// , providing /// <code>in</code> /// with /// <code>size</code> /// bytes /// of buffer. /// <p><strong>Warning:</strong> passing a null source creates a closed /// <code>BufferedInputStream</code> /// . All read operations on such a stream will /// fail with an IOException. /// </summary> /// <param name="in"> /// the /// <code>InputStream</code> /// the buffer reads from. /// </param> /// <param name="size">the size of buffer in bytes.</param> /// <exception cref="System.ArgumentException"> /// if /// <code>size <= 0</code> /// . /// </exception> public BufferedInputStream(java.io.InputStream @in, int size) : base(@in) { if (size <= 0) { throw new System.ArgumentException("size <= 0"); } buf = new byte[size]; }
public void Load(Stream stream) { //FileInputStream stream = new FileInputStream(filePath); java.io.InputStream _javaStream = DroolsDotnetUtil.getJavaInputStreamFromSystemStream(stream); java.io.ObjectInput objInp = new java.io.ObjectInputStream(_javaStream); ((ReteooRuleBase)this._javaRuleBase).readExternal(objInp); _javaStream.close(); }
/// <summary> /// Constructs a new InputStreamReader on the InputStream /// <code>in</code> /// and /// CharsetDecoder /// <code>dec</code> /// . /// </summary> /// <param name="in">the source InputStream from which to read characters.</param> /// <param name="dec">the CharsetDecoder used by the character conversion.</param> public InputStreamReader(java.io.InputStream @in, java.nio.charset.CharsetDecoder dec) : base(@in) { dec.averageCharsPerByte(); this.@in = @in; decoder = dec; bytes.limit(0); }
/// <summary> /// Constructs a new InputStreamReader on the InputStream /// <code>in</code> /// and /// Charset /// <code>charset</code> /// . /// </summary> /// <param name="in">the source InputStream from which to read characters.</param> /// <param name="charset">the Charset that defines the character converter</param> public InputStreamReader(java.io.InputStream @in, java.nio.charset.Charset charset ) : base(@in) { this.@in = @in; decoder = charset.newDecoder().onMalformedInput(java.nio.charset.CodingErrorAction .REPLACE).onUnmappableCharacter(java.nio.charset.CodingErrorAction.REPLACE); bytes.limit(0); }
/// <summary> /// Initializes a new instance of the <see cref="JInputStream"/> class. /// </summary> /// <param name="javaInputStream">The java input stream.</param> public JInputStream(java.io.InputStream javaInputStream) { if (javaInputStream == null) { throw new ArgumentNullException("javaInputStream"); } m_jis = javaInputStream; }
/// <summary> /// Constructs a new /// <code>PushbackInputStream</code> /// with /// <code>in</code> /// as source /// input stream. The size of the pushback buffer is set to /// <code>size</code> /// . /// <p><strong>Warning:</strong> passing a null source creates an invalid /// <code>PushbackInputStream</code> /// . All read operations on such a stream will /// fail. /// </summary> /// <param name="in">the source input stream.</param> /// <param name="size">the size of the pushback buffer.</param> /// <exception cref="System.ArgumentException"> /// if /// <code>size</code> /// is negative. /// </exception> public PushbackInputStream(java.io.InputStream @in, int size) : base(@in) { if (size <= 0) { throw new System.ArgumentException("size <= 0"); } buf = (@in == null) ? null : new byte[size]; pos = size; }
public JavaInputStreamWrapper(java.io.InputStream inputStream) { if (inputStream == null) { throw new ArgumentNullException("inputStream"); } m_in = inputStream; }
public virtual void TestSerializePolyline() { try { java.io.ByteArrayOutputStream streamOut = new java.io.ByteArrayOutputStream(); java.io.ObjectOutputStream oo = new java.io.ObjectOutputStream(streamOut); com.epl.geometry.Polyline pt = new com.epl.geometry.Polyline(); pt.StartPath(10, 10); pt.LineTo(100, 100); pt.LineTo(200, 100); oo.WriteObject(pt); System.IO.BinaryWriter streamIn = new System.IO.BinaryWriter(streamOut.ToByteArray()); java.io.ObjectInputStream ii = new java.io.ObjectInputStream(streamIn); com.epl.geometry.Polyline ptRes = (com.epl.geometry.Polyline)ii.ReadObject(); NUnit.Framework.Assert.IsTrue(ptRes.Equals(pt)); } catch (System.Exception) { Fail("Polyline serialization failure"); } //try //{ //FileOutputStream streamOut = new FileOutputStream("c:/temp/savedPolyline1.txt"); //ObjectOutputStream oo = new ObjectOutputStream(streamOut); //Polyline pt = new Polyline(); //pt.startPath(10, 10); //pt.lineTo(100, 100); //pt.lineTo(200, 100); //oo.writeObject(pt); //} //catch(Exception ex) //{ //fail("Polyline serialization failure"); //} try { java.io.InputStream s = typeof(com.epl.geometry.TestSerialization).GetResourceAsStream("savedPolyline.txt"); java.io.ObjectInputStream ii = new java.io.ObjectInputStream(s); com.epl.geometry.Polyline ptRes = (com.epl.geometry.Polyline)ii.ReadObject(); NUnit.Framework.Assert.IsTrue(ptRes != null); } catch (System.Exception) { Fail("Polyline serialization failure"); } try { java.io.InputStream s = typeof(com.epl.geometry.TestSerialization).GetResourceAsStream("savedPolyline1.txt"); java.io.ObjectInputStream ii = new java.io.ObjectInputStream(s); com.epl.geometry.Polyline ptRes = (com.epl.geometry.Polyline)ii.ReadObject(); NUnit.Framework.Assert.IsTrue(ptRes != null); } catch (System.Exception) { Fail("Polyline serialization failure"); } }
private Socket(rtl.SOCKET handle) #endif { fHandle = handle; #if cooper fSocketInput = fHandle.getInputStream(); fSocketOutput = fHandle.getOutputStream(); #endif }
public override void inflate(android.content.res.Resources r, org.xmlpull.v1.XmlPullParser parser, android.util.AttributeSet attrs) { base.inflate(r, parser, attrs); android.content.res.TypedArray a = r.obtainAttributes(attrs, [email protected]. styleable.NinePatchDrawable); int id = a.getResourceId([email protected]_src, 0); if (id == 0) { throw new org.xmlpull.v1.XmlPullParserException(parser.getPositionDescription() + ": <nine-patch> requires a valid src attribute"); } bool dither = a.getBoolean([email protected]_dither , DEFAULT_DITHER); android.graphics.BitmapFactory.Options options = new android.graphics.BitmapFactory .Options(); if (dither) { options.inDither = false; } options.inScreenDensity = android.util.DisplayMetrics.DENSITY_DEVICE; android.graphics.Rect padding = new android.graphics.Rect(); android.graphics.Bitmap bitmap = null; try { android.util.TypedValue value = new android.util.TypedValue(); java.io.InputStream @is = r.openRawResource(id, value); bitmap = android.graphics.BitmapFactory.decodeResourceStream(r, value, @is, padding , options); @is.close(); } catch (System.IO.IOException) { } // Ignore if (bitmap == null) { throw new org.xmlpull.v1.XmlPullParserException(parser.getPositionDescription() + ": <nine-patch> requires a valid src attribute"); } else { if (bitmap.getNinePatchChunk() == null) { throw new org.xmlpull.v1.XmlPullParserException(parser.getPositionDescription() + ": <nine-patch> requires a valid 9-patch source image"); } } setNinePatchState(new android.graphics.drawable.NinePatchDrawable.NinePatchState( new android.graphics.NinePatch(bitmap, bitmap.getNinePatchChunk(), "XML 9-patch" ), padding, dither), r); mNinePatchState.mTargetDensity = mTargetDensity; a.recycle(); }
/// <summary> /// CopyStream /// </summary> public static void CopyStream(java.io.InputStream from, java.io.OutputStream to) { sbyte[] buffer = new sbyte[8192]; int got; while ((got = from.read(buffer, 0, buffer.Length)) > 0) { to.write(buffer, 0, got); } }
public override void close() { buf = null; java.io.InputStream localIn = @in; @in = null; if (localIn != null) { localIn.close(); } }
/// <summary>Create a drawable by decoding a bitmap from the given input stream.</summary> /// <remarks>Create a drawable by decoding a bitmap from the given input stream.</remarks> public BitmapDrawable(android.content.res.Resources res, java.io.InputStream @is) : this(new android.graphics.drawable.BitmapDrawable.BitmapState(android.graphics.BitmapFactory .decodeStream(@is)), null) { mBitmapState.mTargetDensity = mTargetDensity; if (mBitmap == null) { android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + @is); } }
public virtual void TestSerializeMultiPoint() { try { java.io.ByteArrayOutputStream streamOut = new java.io.ByteArrayOutputStream(); java.io.ObjectOutputStream oo = new java.io.ObjectOutputStream(streamOut); com.epl.geometry.MultiPoint pt = new com.epl.geometry.MultiPoint(); pt.Add(10, 30); pt.Add(120, 40); oo.WriteObject(pt); System.IO.BinaryWriter streamIn = new System.IO.BinaryWriter(streamOut.ToByteArray()); java.io.ObjectInputStream ii = new java.io.ObjectInputStream(streamIn); com.epl.geometry.MultiPoint ptRes = (com.epl.geometry.MultiPoint)ii.ReadObject(); NUnit.Framework.Assert.IsTrue(ptRes.Equals(pt)); } catch (System.Exception) { Fail("MultiPoint serialization failure"); } //try //{ //FileOutputStream streamOut = new FileOutputStream("c:/temp/savedMultiPoint1.txt"); //ObjectOutputStream oo = new ObjectOutputStream(streamOut); //MultiPoint pt = new MultiPoint(); //pt.add(10, 30); //pt.add(120, 40); //oo.writeObject(pt); //} //catch(Exception ex) //{ //fail("MultiPoint serialization failure"); //} try { java.io.InputStream s = typeof(com.epl.geometry.TestSerialization).GetResourceAsStream("savedMultiPoint.txt"); java.io.ObjectInputStream ii = new java.io.ObjectInputStream(s); com.epl.geometry.MultiPoint ptRes = (com.epl.geometry.MultiPoint)ii.ReadObject(); NUnit.Framework.Assert.IsTrue(ptRes.GetPoint(1).GetY() == 40); } catch (System.Exception) { Fail("MultiPoint serialization failure"); } try { java.io.InputStream s = typeof(com.epl.geometry.TestSerialization).GetResourceAsStream("savedMultiPoint1.txt"); java.io.ObjectInputStream ii = new java.io.ObjectInputStream(s); com.epl.geometry.MultiPoint ptRes = (com.epl.geometry.MultiPoint)ii.ReadObject(); NUnit.Framework.Assert.IsTrue(ptRes.GetPoint(1).GetY() == 40); } catch (System.Exception) { Fail("MultiPoint serialization failure"); } }
/// <summary>Returns a byte[] containing the remainder of 'in', closing it when done. /// </summary> /// <remarks>Returns a byte[] containing the remainder of 'in', closing it when done. /// </remarks> /// <exception cref="System.IO.IOException"></exception> public static byte[] readFully(java.io.InputStream @in) { try { return(readFullyNoClose(@in)); } finally { @in.close(); } }
void org.xmlpull.v1.XmlPullParser.setInput(java.io.InputStream arg0, java.lang.String arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::org.xmlpull.v1.XmlPullParser_._setInput16560, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::org.xmlpull.v1.XmlPullParser_.staticClass, global::org.xmlpull.v1.XmlPullParser_._setInput16560, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } }
public override void engineLoad(java.io.InputStream arg0, char[] arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::java.security.KeyStoreSpi_._engineLoad14847, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::java.security.KeyStoreSpi_.staticClass, global::java.security.KeyStoreSpi_._engineLoad14847, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } }
/// <summary> /// Constructs an audio input stream that reads its data from the target /// data line indicated. /// </summary> /// <remarks> /// Constructs an audio input stream that reads its data from the target /// data line indicated. The format of the stream is the same as that of /// the target data line, and the length is AudioSystem#NOT_SPECIFIED. /// </remarks> /// <param name="line">the target data line from which this stream obtains its data.</param> /// <seealso cref="AudioSystem.NOT_SPECIFIED">AudioSystem.NOT_SPECIFIED</seealso> public AudioInputStream(TargetDataLine line) { AudioInputStream.TargetDataLineInputStream tstream = new AudioInputStream.TargetDataLineInputStream (this, line); format = line.getFormat(); frameLength = AudioSystem.NOT_SPECIFIED; frameSize = format.getFrameSize(); if (frameSize == AudioSystem.NOT_SPECIFIED || frameSize <= 0) { frameSize = 1; } this.stream = tstream; framePos = 0; markpos = 0; }
/// <summary> /// Creates a <code>FilteredAudioInputStream</code> with the specified buffer /// size, and saves its argument, the inputstream <code>in</code> for later use. /// </summary> /// <remarks> /// Creates a <code>FilteredAudioInputStream</code> with the specified buffer /// size, and saves its argument, the inputstream <code>in</code> for later use. /// An internal buffer array of length <code>size</code> is created and stored /// in <code>buf</code>. /// </remarks> /// <param name="in">the underlying input stream.</param> /// <param name="format">the format of this stream's audio data.</param> /// <param name="length">the length in sample frames of the data in this stream.</param> /// <param name="size">the buffer size.</param> /// <param name="presize">the prebuffer size.</param> /// <exception> /// IllegalArgumentException /// if size <= 0 or presize <= 0. /// </exception> public FilteredAudioInputStream(java.io.InputStream @in, javax.sound.sampled.AudioFormat format, long length, int size, int presize) : base(@in, format, length) { this.@in = @in; if ((size <= 0) || (presize <= 0)) { throw new System.ArgumentException("Buffer size <= 0"); } buf = new byte[size]; count = 0; prebuf = new byte[presize]; precount = 0; marklimit = size; markpos = -1; }
internal ZipEntryStream(java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry entry) { this.zipFile = zipFile; this.entry = entry; inp = zipFile.getInputStream(entry); }
/// <summary> /// Constructs an audio input stream that has the requested format and length in sample frames, /// using audio data from the specified input stream. /// </summary> /// <remarks> /// Constructs an audio input stream that has the requested format and length in sample frames, /// using audio data from the specified input stream. /// </remarks> /// <param name="stream"> /// the stream on which this <code>AudioInputStream</code> /// object is based /// </param> /// <param name="format">the format of this stream's audio data</param> /// <param name="length">the length in sample frames of the data in this stream</param> public AudioInputStream(java.io.InputStream stream, AudioFormat format, long length) : base() { this.format = format; this.frameLength = length; this.frameSize = format.getFrameSize(); // any frameSize that is not well-defined will // cause that this stream will be read in bytes if (this.frameSize == AudioSystem.NOT_SPECIFIED || frameSize <= 0) { this.frameSize = 1; } this.stream = stream; framePos = 0; markpos = 0; }
/// <summary> /// Closes this input stream and releases any system resources associated with /// the stream. /// </summary> /// <remarks> /// Closes this input stream and releases any system resources associated with /// the stream. /// </remarks> /// <exception> /// IOException /// if an I/O error occurs. /// </exception> /// <exception cref="System.IO.IOException"></exception> public override void close() { lock (this) { if (@in == null) { return; } @in.close(); @in = null; buf = null; prebuf = null; } }
private void StartInstanceBlocked() { if (interpreter == null) { if (UseStreams) { outStream = getOutputStream(); inStream = getInputStream(); interpreter = Interpreter.createJLispInstance(inStream, outStream, ".", VersionString); return; } interpreter = Interpreter.createDefaultInstance(new String[0]); } }
public override void close() { lock (@lock) { if (decoder != null) { decoder.reset(); } decoder = null; if (@in != null) { @in.close(); @in = null; } } }
public StreamGobbler(java.io.InputStream ins, String type) { this._is = ins; this._type = type; }
public InputStreamWrapper (java.io.InputStream ins) { _ins = ins; }
/// <summary> /// Constructs a new /// <code>FilterInputStream</code> /// with the specified input /// stream as source. /// <p><strong>Warning:</strong> passing a null source creates an invalid /// <code>FilterInputStream</code> /// , that fails on every method that is not /// overridden. Subclasses should check for null in their constructors. /// </summary> /// <param name="in">the input stream to filter reads on.</param> protected internal FilterInputStream(java.io.InputStream @in) { this.@in = @in; }