public PlainSocketImpl(FileDescriptor fd, int localport, InetAddress addr, int port) { this.fd = fd; this.localport = localport; this.address = addr; this.port = port; if (fd.valid()) { guard.open("close"); } }
/** * This constructor allows to create an inflater that expects no header from * the input stream. * * @param noHeader * {@code true} indicates that no ZLIB header comes with the * input. */ public Inflater(boolean noHeader) { streamHandle = createStream(noHeader); guard.open("end"); }
public PlainSocketImpl(FileDescriptor fd) { this.fd = fd; if (fd.valid()) { guard.open("close"); } }
public PlainDatagramSocketImpl(FileDescriptor fd, int localPort) { this.fd = fd; this.localPort = localPort; if (fd.valid()) { guard.open("close"); } }
/** * Constructs a new {@code Deflater} instance with the * given <a href="#compression_level">compression level</a>. * If {@code noHeader} is true, no ZLIB header is added to the * output. In a zip file, every entry (compressed file) comes with such a * header. The strategy can be specified using {@link #setStrategy}. */ public Deflater(int level, boolean noHeader) { if (level < DEFAULT_COMPRESSION || level > BEST_COMPRESSION) { throw new IllegalArgumentException("Bad level: " + level); } compressLevel = level; streamHandle = createStream(compressLevel, strategy, noHeader); guard.open("end"); }
/** * Constructs a new {@code FileInputStream} that reads from {@code file}. * * @param file * the file from which this stream reads. * @throws FileNotFoundException * if {@code file} does not exist. */ public FileInputStream(File file) throws FileNotFoundException { if (file == null) { throw new NullPointerException("file == null"); } this.fd = IoBridge.open(file.getAbsolutePath(), O_RDONLY); this.shouldClose = true; guard.open("close"); }
/** * Constructs a new {@code FileOutputStream} that writes to {@code file}. * If {@code append} is true and the file already exists, it will be appended to; otherwise * it will be truncated. The file will be created if it does not exist. * * @throws FileNotFoundException if the file cannot be opened for writing. */ public FileOutputStream(File file, boolean append) throws FileNotFoundException { if (file == null) { throw new NullPointerException("file == null"); } this.mode = O_WRONLY | O_CREAT | (append ? O_APPEND : O_TRUNC); this.fd = IoBridge.open(file.getAbsolutePath(), mode); this.shouldClose = true; this.guard.open("close"); }
/** * Constructs a new {@code ZipFile} allowing access to the given file. * The {@code mode} must be either {@code OPEN_READ} or {@code OPEN_READ|OPEN_DELETE}. * * <p>If the {@code OPEN_DELETE} flag is supplied, the file will be deleted at or before the * time that the {@code ZipFile} is closed (the contents will remain accessible until * this {@code ZipFile} is closed); it also calls {@code File.deleteOnExit}. * * @throws IOException if an {@code IOException} occurs. */ public ZipFile(File file, int mode) throws IOException { filename = file.getPath(); if (mode != OPEN_READ && mode != (OPEN_READ | OPEN_DELETE)) { throw new IllegalArgumentException("Bad mode: " + mode); } if ((mode & OPEN_DELETE) != 0) { fileToDeleteOnClose = file; fileToDeleteOnClose.deleteOnExit(); } else { fileToDeleteOnClose = null; } raf = new RandomAccessFile(filename, "r"); readCentralDir(); guard.open("close"); }
/** * Creates a socket on the specified interface. */ public RawSocket(String interfaceName, short protocolType) throws SocketException { mInterfaceName = interfaceName; mProtocolType = protocolType; fd = new FileDescriptor(); create(fd, mProtocolType, mInterfaceName); guard.open("close"); }
guard.open("close");
ReflectionHelpers.setField(MediaMuxer.class, realMuxer, "mNativeObject", nativeObject); ReflectionHelpers.setField(MediaMuxer.class, realMuxer, "mState", MUXER_STATE_INITIALIZED); guard.open("release"); } else { ReflectionHelpers.callInstanceMethod(
public PlainSocketImpl(FileDescriptor fd) { this.fd = fd; if (fd.valid()) { guard.open("close"); } }
public PlainDatagramSocketImpl(FileDescriptor fd, int localPort) { this.fd = fd; this.localPort = localPort; if (fd.valid()) { guard.open("close"); } }
/** * This constructor allows to create an inflater that expects no header from * the input stream. * * @param noHeader * {@code true} indicates that no ZLIB header comes with the * input. */ public Inflater(boolean noHeader) { streamHandle = createStream(noHeader); guard.open("end"); }
public PlainSocketImpl(FileDescriptor fd) { this.fd = fd; if (fd.valid()) { guard.open("close"); } }
/** * This constructor allows to create an inflater that expects no header from * the input stream. * * @param noHeader * {@code true} indicates that no ZLIB header comes with the * input. */ public Inflater(boolean noHeader) { streamHandle = createStream(noHeader); guard.open("end"); }
/** * This constructor allows to create an inflater that expects no header from * the input stream. * * @param noHeader * {@code true} indicates that no ZLIB header comes with the * input. */ public Inflater(boolean noHeader) { streamHandle = createStream(noHeader); guard.open("end"); }
public PlainSocketImpl(FileDescriptor fd) { this.fd = fd; if (fd.valid()) { guard.open("close"); } }
public PlainSocketImpl(FileDescriptor fd) { this.fd = fd; if (fd.valid()) { guard.open("close"); } }
/** * Creates a socket on the specified interface. */ public RawSocket(String interfaceName, short protocolType) throws SocketException { mInterfaceName = interfaceName; mProtocolType = protocolType; fd = new FileDescriptor(); create(fd, mProtocolType, mInterfaceName); guard.open("close"); }