Here you can find the source of getOutputStreamForFile(final File file)
OutputStream
from it.
Parameter | Description |
---|---|
file | <code>File</code> from which the <code>OutputStream</code> is created. |
Parameter | Description |
---|---|
IOException | an exception |
OutputStream
.
public static OutputStream getOutputStreamForFile(final File file) throws FileNotFoundException
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2014 Alexander Kerner. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License./* ww w . j av a 2 s .c o m*/ ******************************************************************************/ import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; public class Main { /** * Reads a file an returns an <code>OutputStream</code> from it. * * @param file * <code>File</code> from which the <code>OutputStream</code> is * created. * @return the <code>OutputStream</code>. * @throws IOException */ public static OutputStream getOutputStreamForFile(final File file) throws FileNotFoundException { return new FileOutputStream(file); } }